小编Cae*_*ael的帖子

如何解决,没有名为“tf”的模块?

我尝试使用以下代码将我的 CNN 模型 .h5 文件转换为 .tflite 文件:

import tensorflow as tf
from tf.lite import TFLiteConverter

converter = lite.TFLiteConverter.from_saved_model('/drive/My Drive/FSD_modelV09A.h5')
tflite_model = converter.convert()
open("/drive/My Drive/FSD_modelV09A.tflite", "wb").write(tflite_model)
Run Code Online (Sandbox Code Playgroud)

但是然后有一个错误说:

ModuleNotFoundError: No module named 'tf'
Run Code Online (Sandbox Code Playgroud)

machine-learning conv-neural-network keras tensorflow

2
推荐指数
1
解决办法
3814
查看次数