I follow the Keras CIFAR10 study guide here . The only changes I made were:
[a] added at the end of the training file
model.save_weights('./weights.h5', overwrite=True)
[b] changed ~. / keras / keras.json to
{"floatx": "float32", "backend": "tensorflow", "epsilon": 1e-07}
I can successfully run the model.
Then I want to test one image against a trained model. My code is:
[... similar to tutorial file with model being created and compiled...] ... model = Sequential() ... model.compile() model.load_weights('./ddx_weights.h5') img = cv2.imread('car.jpeg', -1)
I get this error:
ValueError: Cannot feed value of shape (1, 32, 3) for Tensor 'convolution2d_input_1:0', which has shape '(?, 3, 32, 32)'
What is the correct way to change the input data for one test image?
I have not added "image_dim_ordering": "tf" to ./keras/keras.json .
source share