A problem when run tflite model(the result of tflite model is nan)

老子叫甜甜 提交于 2021-02-10 22:42:24

问题


I trained a model to convert sketch picture to color picture. enter image description here middle is ground truth, left is original and right is pridiction. This result was ran by model.h5 but there is a wrong result when i run program using model.tflite.

this is my convert code

tflite_convert --keras_model_file=G:/pix2pix/generator.h5 --output_file=G:/pix2pix/convert.tflite

this is the result ran by model.tflite

[[[[nan nan nan] ...

回答1:


I find a solution about this question. Just change the attribute fused of tf.keras.layers.bn to false. The output is correct.



来源:https://stackoverflow.com/questions/60513183/a-problem-when-run-tflite-modelthe-result-of-tflite-model-is-nan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!