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
Predict value error Between keras model and pb model #109
Comments
I removed the
|
Thank you @youyuge34 |
@amir-abdi I researched more, and I found the problem was casused by using function To be compatible with most cases, maybe keep the If someone has the same problem as me, PLZ try to remove |
Hi, I am experiencing the same issue, the result I have for hdf5/h5 is really different from the result I have for the pb file. On the hdf5 end (via anaconda python 3.7, tf 1.13.1), I have resized the test images, then normalized it (float 255) I have also tested the pb at the windows application (via visual studio), the result is funny as well. I have tried your solution, but it does not help to correct the model behavior. |
@lizq-git make sure the input arrays of model are totally the same~ |
I tried both on
tf-gpu1.4+keras2.1.3
and ontf-gpu1.12+keras2.2.4
and the problem always happens.The problem is: After I converted the keras.application.ResNet50() model into freeze graph model in .pb format, I feed in the same picture into the converted .pb model but the output value changes just a little.
Firstly I save the keras.application.ResNet50() model with .h5 format using keras API:
And the first 10 elements of the predict vector is:
Then I used this repo to convert the .h5 file into .pb file:
Finally I load the pb model and predict the same image again:
But the predict vector value changes a little, which is really strange:
I also rewrite my own freeze graph tool to convert .h5 into .pb, but the problem is just the same.
PLZ help!
The text was updated successfully, but these errors were encountered: