keras_to_tensorflow
keras_to_tensorflow copied to clipboard
Random Guess after converting to .pb file.
Hi First of all, thanks for your work. I have a small problem and I do not know from where it comes from. I have used your code to convert a Keras model into a .pb file in order to use it for inference on and Android application. I have taken the model from a GitHub repository which provides a demo.py file to check their work. I ran the demo and the prediction was OKay to some extent. On the other hand, The problem I faced is that the android application is giving me 0.5 accuracy when inferring on Android which is kind of guessing unlike the demo.py from where I have extracted the model. I am really confused. I do not know where the problem is! I notice that android gives me a warning saying that "Skipped 151 frames! The application may be doing too much work on its main thread." I know that this means the UI thread is doing heavy work due to the inference and I need to practice multi threading programming. However, does this contribute to the problem of random guess of my model?
Thanks in advance
@MagedSaeed I also met the problem,when I convert the h5 model to pb,and use it in tensorflow, but the result isnt match,what' wrong??
Hi @kingrain213 My problem was the input image to the model. The model requires BGR images instead of RGB. I converted the image and it works better. You may need to check the requirements of the model first.
Here is a summary of what I did. I wrote it on the stackoverflow.com:
https://stackoverflow.com/a/49582776/4412324
I am having issue in python itself. I checked it, the Keras model prediction is correct and it is different from the tensorflow .pb model prediction. Tensorflow .pb model prediction code is used from label_image.py ie from tensorflow poets.
@kingrain213 Hi~ Have you solved the problem? I got the same ,Can you give me some advice? Thanks in advance!!!!