keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
62.14k stars 19.49k forks source link

Siamese graph MNIST example "get_item" error in Keras 0.3.3 #2201

Closed PhyloStar closed 7 years ago

PhyloStar commented 8 years ago

Hi,

I was testing the graph models and could not get to run the "mnist_siamese_graph.py" file in the examples folder. I did not get the same error when I used Keras 0.3.2.

Using Theano backend. Traceback (most recent call last): File "../mnist_siamese_graph.py", line 111, in g.compile(loss={'output': contrastive_loss}, optimizer=rms) File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 1265, in compile if self.outputs[self.output_order[0]].output_shape[-1] == 1: TypeError: 'NoneType' object has no attribute 'getitem'

jcpeterson commented 8 years ago

Any update? I can't run this either, but I get a different error:

Traceback (most recent call last): File "model3.py", line 103, in distance = Lambda(euclidean_distance)([processed_a, processed_b]) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 485, 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 543, 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 167, in create_node str(output_shapes)) Exception: The get_output_shape_for method of layer "lambda_1"" should return one shape tuple per output tensor of the layer. Found: [(None, 128), (None, 128)]

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.