我想确定我执行的获得yolov2-lite模型的tflite的下列步骤是否正确?
Step1将图和权值保存到原始文件
flow --model cfg/yolov2-tiny.cfg --load bin/yolov2-tiny.weights --savepb。
此命令使用yolov2-tiny.pb和yolov2-tiny.meta创建build_graph文件夹。
Step2将pb转换为tflite
我执行了下面的代码以获得yolov2-tiny.tflite
import tensorflow as tf
localpb = 'yolov2-tiny.pb'
tflite_file = 'yolov2-tiny.tflite'
print("{} -> {}".format(localpb, tflite_file))
converter = tf.lite.TFLiteConverter.from_frozen_graph(
localpb,
input_arrays= ['input'],
output_arrays= ['output']
)
tflite_model = converter.convert()
open(tflite_file,'wb').write(tflite_model)
interpreter = tf.lite.Interpreter(model_content=tflite_model)
interpreter.allocate_tensors()如果上述步骤是正确的,那么请建议我在珊瑚边缘TPU USB加速器中运行这个tflite文件。
(非常感谢:)
发布于 2019-11-05 15:56:57
不幸的是,到目前为止,edgetpu编译器支持yolo模型。我建议使用mobile_ssd模型。
供将来参考,你的管道应该是:
1)模型的训练
2)转换为tflite
3)为EdgeTPU编译的(实际将工作委托给TPU的步骤)
https://stackoverflow.com/questions/58687216
复制相似问题