error of image size in vgg16.py
ajinkya933 opened this issue · 3 comments
When I run python vgg16.py I get:
ValueError: Cannot feed value of shape (1, 1, 224, 224, 3) for Tensor 'input_1:0', which has shape '(?, 224, 224, 3)'
How to remove this error ?
I ran the file vgg16.py on master and it worked perfectly.
It seems that your problem comes from the shape of the image.
You should have (1, 224, 224, 3) and not (1, 1, 224, 224, 3).
So try to do image[0] and not image.
It should work!
@philipperemy I changed to image[0]as shown
activations = keract.get_activations(model, image[0])
but now I get error:
File "C:\Users\Ajinkya\Anaconda3\lib\site-packages\keras\engine\training_utils.py", line 126, in standardize_input_data
'with shape ' + str(data_shape))
ValueError: Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (224, 224, 3)
How to resolve it ?
activations = keract.get_activations(model, image[0:1])
Or
activations = keract.get_activations(model, np.expand_dims(image[0], axis=0))
I'd say.