Error in getting predictions
Closed this issue · 3 comments
Line 245 in b5e40c3
output_shape=lambda x: (x[0][0], 1))([left_output, right_output]) Traceback (most recent call last): File "test.py", line 245, in <module> model.load_weights("model30_relu_epoch_3.h5") File "build/bdist.linux-x86_64/egg/keras/engine/topology.py", line 2639, in load_weights File "build/bdist.linux-x86_64/egg/keras/engine/topology.py", line 3159, in load_weights_from_hdf5_g roup File "build/bdist.linux-x86_64/egg/keras/backend/tensorflow_backend.py", line 2370, in batch_set_val ue File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 975, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (75318, 300) for Tensor u'embedding_1/Placeholder:0', which has shape '(12, 300)'
Hi @prats226 ,
Can you let me know the input arguments used while running the script for easy reproducibility of the error?
Also, the model dimension ordering is as per Keras with Theano backend. Are you using TensorFlow as backend? I'll explore this point.
python test.py "Who will be the next captain of Indian cricket team?" "Will Indian cricket team have a captain soon?"
Just used this example. I am using tensorflow backend.
{ "epsilon": 1e-07, "floatx": "float32", "image_data_format": "channels_last", "backend": "tensorflow", "image_dim_ordering": "tf" }
300 here is I am assuming size of encoding so issue is with other dimension.
Rectified the shape mismatch issue occurring with TensorFlow backend. Please let me know if you still face the same error.