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

the problem in running #22

Open
Twinkle123321 opened this issue Oct 22, 2017 · 2 comments
Open

the problem in running #22

Twinkle123321 opened this issue Oct 22, 2017 · 2 comments

Comments

@Twinkle123321
Copy link

Thanks,your tutorial and code very well explained LSTM for a beginner like me,however,when I run it on pycharm(based on python3.6,keras1.0.7),it shows as follows:
File "C:/Users/Guo/Desktop/household_power_consumption/predict.py", line 132, in
run_network()
File "C:/Users/Guo/Desktop/household_power_consumption/predict.py", line 105, in run_network
model = build_model()
File "C:/Users/Guo/Desktop/household_power_consumption/predict.py", line 67, in build_model
return_sequences=True))
TypeError: Expected int32, got <tf.Variable 'lstm_1_W_i:0' shape=(1, 50) dtype=float32_ref> of type 'Variable' instead.

I wonder if it's the version-compatibility,would you give me some advice?
really,thank you again

@vict0rsch
Copy link
Owner

vict0rsch commented Oct 22, 2017

Hey,

It may indeed come from the change in versions of Keras, the code used to run. However the error seems quite clear : it expected a type of int32 (32 bits integer) and got a Variable with dtype float32 (32bits float).

Can't say for sure, it seems like you've changed the code somehow but I'd bet on this: LSTM() expects an int as number of neurons in the layer but you gave a tensorflow variable from the previous LSTM layer instead. Could simply be that you inverted the order of arguments

@Twinkle123321
Copy link
Author

you're so kind,thank you so much,I found that when I change the backend tensorflow into theano,the code can run smothly.

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