Keras: LSTM error with current version of tensorflow 1.0.0-rc1

Created on 4 Feb 2017  路  5Comments  路  Source: keras-team/keras

When I add an LSTM with

from keras.models import Sequential
from keras.layers import Dense 
from keras.layers import LSTM

look_back = 1 
batch_size = 1 
model = Sequential()  
model.add(LSTM(4, batch_input_shape=(batch_size, look_back, 1), stateful=True, return_sequences=True))

I get an error

_TypeError: Expected int32, got of type 'Variable' instead._

This did not happen with the previous version of tensorflow.

Most helpful comment

It looks like keras version 1.2.2 has fixed this problem.

All 5 comments

It looks like keras version 1.2.2 has fixed this problem.

I have Keras 2.0.4 with tensorflow 1.1.0, but I am seeing the same issue.

same problem here. Any suggestions? @miaosenwang did you manage to solve it?

@paolorota I had compatibility issues between python 3.6, keras, and tensorflow. I fixed it by downgrading my python and reinstall everything. The latest tensorflow release has 3.6 support. Maybe you can try that.

alright... I finally solved by UPDATING everything to the last release (for some reasons I had troubles to upgrade to 1.x version of tensorflow). Thanks for your suggestion though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farizrahman4u picture farizrahman4u  路  3Comments

LuCeHe picture LuCeHe  路  3Comments

KeironO picture KeironO  路  3Comments

fredtcaroli picture fredtcaroli  路  3Comments

NancyZxll picture NancyZxll  路  3Comments