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

Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2 #5

Open
anthdm opened this issue May 11, 2017 · 1 comment

Comments

@anthdm
Copy link

anthdm commented May 11, 2017

When running the code I get the following error.

Using Theano backend.
model.py:20: UserWarning: Update your `LSTM` call to the Keras 2 API: `LSTM(kernel_initializer="glorot_normal", input_shape=(15,), recurrent_initializer="glorot_normal", units=300, return_sequences=True, activation="sigmoid")`
  model.add(LSTM(output_dim=300,input_shape=x_train.shape[1:],return_sequences=True, init='glorot_normal', inner_init='glorot_normal', activation='sigmoid'))
Traceback (most recent call last):
  File "model.py", line 20, in <module>
    model.add(LSTM(output_dim=300,input_shape=x_train.shape[1:],return_sequences=True, init='glorot_normal', inner_init='glorot_normal', activation='sigmoid'))
  File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 430, in add
    layer(x)
  File "/usr/local/lib/python2.7/site-packages/keras/layers/recurrent.py", line 257, in __call__
    return super(Recurrent, self).__call__(inputs, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/keras/engine/topology.py", line 534, in __call__
    self.assert_input_compatibility(inputs)
  File "/usr/local/lib/python2.7/site-packages/keras/engine/topology.py", line 433, in assert_input_compatibility
    str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2  
@thomasnt13
Copy link

@anthdm : any luck on this?

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