Skip to content
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

ValueError: The shape of the input to "Flatten" is not fully defined . Make sure to pass a complete "input_shape" or "batch_input #1

Open
AgrawalAmey opened this issue Jun 9, 2017 · 2 comments

Comments

@AgrawalAmey
Copy link

I am trying to run the classification/mvcnn_FPS.py script with Keras 1.2.2 (the one specified in the requirements.txt) but the execution fails with the following error.

Using Theano backend.
Using cuDNN version 5110 on context None
Mapped name None to device cuda: GeForce GTX 1070 (0000:01:00.0)
Traceback (most recent call last):
  File "mvcnn_FPS.py", line 224, in <module>
    vggmodel = load_model_vgg()
  File "mvcnn_FPS.py", line 33, in load_model_vgg
    x = Flatten(name='flatten')(x)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in __call__
    self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 635, in add_inbound_node
    Node.create_node(self, inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 170, in create_node
    output_shapes = to_list(outbound_layer.get_output_shape_for(input_shapes[0]))
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 476, in get_output_shape_for
    '(got ' + str(input_shape[1:]) + '. '
ValueError: The shape of the input to "Flatten" is not fully defined (got (512, 7, 0). Make sure to pass a complete "input_shape" or "batch_input
_shape" argument to the first layer in your model.
@bradyz
Copy link
Owner

bradyz commented Jun 9, 2017

I didn't write this one so I'm not quite sure - have you tried models in the model directory?

@AgrawalAmey
Copy link
Author

Okay, I would try those. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants