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: Shapes (4, 100, 50) and () are incompatible源程序报错 #22

Open
yezhaoguli opened this issue Jun 3, 2021 · 0 comments

Comments

@yezhaoguli
Copy link

Traceback (most recent call last):
File "Sentiment_lstm.py", line 204, in
lstm_predict(string)
File "Sentiment_lstm.py", line 178, in lstm_predict
model = model_from_yaml(yaml_string)
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/models.py", line 187, in model_from_yaml
return layer_from_config(config, custom_objects=custom_objects)
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 36, in layer_from_config
return layer_class.from_config(config['config'])
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/models.py", line 1036, in from_config
model.add(layer)
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/models.py", line 312, in add
output_tensor = layer(self.outputs[0])
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/engine/topology.py", line 487, in call
self.build(input_shapes[0])
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/layers/recurrent.py", line 710, in build
self.W = K.concatenate([self.W_i, self.W_f, self.W_c, self.W_o])
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 718, in concatenate
return tf.concat(axis, [to_dense(x) for x in tensors])
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/tensorflow/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1254, in concat
tensor_shape.scalar())
File "/home/user/anaconda3/envs/gu_py27/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 1023, in assert_is_compatible_with
raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (4, 100, 50) and () are incompatible

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

1 participant