Hi,
I am a Keras rookie. You can call me chunyue.
I have installed the keras and theano successfully at the latest version with the following command :
Today I try some codes at your blog from this link "http://benjaminbolte.com/blog/2016/keras-language-modeling.html" , and the code is attached and I got an error as follows,
'''
TypeError: Cannot convert Type TensorType(float32, 3D) (of Variable Subtensor{:int64:}.0) into Type TensorType(float32, (False, False, True)). You can try to manually convert Subtensor{:int64:}.0 into a TensorType(float32, (False, False, True)).
'''
After google it, I found the link "https://github.com/fchollet/keras/issues/3515" is talking my problems. So I try the code there as follows, and also got the same error information
from keras.layers import LSTM
from keras.models import Sequential
import numpy as np
model = Sequential()
model.add(LSTM(1, input_shape=(3, 2)))
model.compile(loss='mse', optimizer='sgd')
x = np.random.random((4, 3, 2))
y = np.random.random((4, 1))
model.fit(x, y)
The same error will happen when LSTM is replaced with SimpleRNN.
So, What I should do to solve it? Now I just find setup the unroll=True can fix it.
Best regards.
Hi, I am a Keras rookie. You can call me chunyue. I have installed the keras and theano successfully at the latest version with the following command :
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
Today I try some codes at your blog from this link "http://benjaminbolte.com/blog/2016/keras-language-modeling.html" , and the code is attached and I got an error as follows, ''' TypeError: Cannot convert Type TensorType(float32, 3D) (of Variable Subtensor{:int64:}.0) into Type TensorType(float32, (False, False, True)). You can try to manually convert Subtensor{:int64:}.0 into a TensorType(float32, (False, False, True)). ''' After google it, I found the link "https://github.com/fchollet/keras/issues/3515" is talking my problems. So I try the code there as follows, and also got the same error information
from keras.layers import LSTM from keras.models import Sequential import numpy as np
model = Sequential() model.add(LSTM(1, input_shape=(3, 2))) model.compile(loss='mse', optimizer='sgd')
x = np.random.random((4, 3, 2)) y = np.random.random((4, 1))
model.fit(x, y)
The same error will happen when LSTM is replaced with SimpleRNN. So, What I should do to solve it? Now I just find setup the unroll=True can fix it. Best regards.