-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Error]:ValueError: Cannot feed value of shape (1, 3, 224, 224) for Tensor u'input_1_1:0', which has shape '(?, ?, ?, 3)' #90
Comments
I found |
And, when i was using |
I had similar problems when modifying the example code for Inception V3. My issue was solved by defining the
and then changing the image load size to
|
I had the same problem when using variable sized inputs.
The problem is that in Keras, variable shaped entries in the model are defined as For example the model input could have shape My quickfix was just to comment out the two lines in
|
I am doing it on my own network:
But, i get the error:
Traceback (most recent call last):
File
"/Users/qiu/Documents/cwzpaper/video_classification/video_classification/single_frame_cnn/visualization.py", line 43, in
grads = visualize_saliency(model, layer_idx, filter_indices=0, seed_input=img)
File "/anaconda/lib/python2.7/site-packages/vis/visualization/saliency.py", line 125, in visualize_saliency
return visualize_saliency_with_losses(model.input, losses, seed_input, grad_modifier)
File "/anaconda/lib/python2.7/site-packages/vis/visualization/saliency.py", line 73, in visualize_saliency_with_losses
grads = opt.minimize(seed_input=seed_input, max_iter=1, grad_modifier=grad_modifier, verbose=False)[1]
File "/anaconda/lib/python2.7/site-packages/vis/optimizer.py", line 143, in minimize
computed_values = self.compute_fn([seed_input, 0])
File "/anaconda/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2273, in call
**self.session_kwargs)
File "/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 895, in run
run_metadata_ptr)
File "/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1100, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (1, 3, 224, 224) for Tensor u'input_1_1:0', which has shape '(?, ?, ?, 3)'
My image format is channel_last. How can I solve it? Thank you!
The text was updated successfully, but these errors were encountered: