-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Tensor conversion requested dtype int32 for Tensor with dtype float32 #7460
Comments
same problem |
Not sure if this is the general case, but I observed this error when training models using Keras 2.0.5 and loading in Keras 2.0.6. If I retrain the model in 2.0.6, I can successfully reload the model using |
Same problem. |
Same problem |
I get the same issue when using model saved in Keras 2.0.5 and loading in Keras 2.0.6 |
The workaround I found is to save only weights and recreate the model in the code and load just the weights. |
is there work around for this issue |
switching to Keras 2.0.5 worked for me |
What is really the solution for this issue? I am facing the same problem. |
update and retrain |
@ft512835 What do you mean by "update and retrain"? How can I fix the error? |
@HangsunKim what version of your Keras and Tensorflow? |
@ft512835 |
@HangsunKim Is it possible that you trained the model using a different version of Keras and Tensorflow? I observed this problem, after switching to a new version of Keras.. |
Hey, |
I think @adityac8 is right, roll back to the low version of Keras work for me. |
If any one is still facing this issue even after training and loading on the same version of Keras and Tensorflow, (which I did), just casting it manually to dtype float32 worked for me. here is a sample code snippet resembling my original problem (using the Functional API):
The lambda layer is used to convert a Tensorflow tensor to a Keras one. |
Any workarounds to this problem yet? I have the entire model saved instead of the weights |
i m trying to train images with train.py using tensorflow getting same error can someone tell me when and why this error occurs? |
When I try to load a model (
keras.models.load_model()
) that was saved by Keras using tensorflow 1.1 on a tensorflow 1.2 based keras I got following error:The text was updated successfully, but these errors were encountered: