【问题标题】:A problem when run tflite model(the result of tflite model is nan)运行 tflite 模型时出现问题(tflite 模型的结果是 nan)
【发布时间】:2020-03-03 18:06:19
【问题描述】:

我训练了一个模型来将素描图片转换为彩色图片。 enter image description here 中间是基本事实,左边是原创,右边是预测。此结果由 model.h5 运行,但当我使用 model.tflite 运行程序时出现错误结果。

这是我的转换代码

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

这是 model.tflite 运行的结果

[[[[nan nan nan] ...

【问题讨论】:

    标签: python tensorflow tensorflow-lite


    【解决方案1】:

    我找到了关于这个问题的解决方案。只需将 tf.keras.layers.bn 的 fused 属性更改为 false 即可。输出是正确的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-29
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      • 1970-01-01
      • 1970-01-01
      • 2020-07-13
      • 2023-01-31
      相关资源
      最近更新 更多