如何运行 yolov2-lite tflite in coral edge TPU USB 加速器?
How to run yolov2-lite tflite in coral edge TPU USB accelerator?
我想确定一下我为了获得yolov2-lite模型的tflite
而执行的以下步骤是否正确?
Step1 将图和权重保存到 protobuf 文件
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()
如果我按照上述步骤获取这个 tflite 是正确的,那么请建议我在 coral edge TPU USB 加速器中 运行 这个 tflite 文件的命令。
非常感谢:)
不幸的是,yolo 模型目前受 edgetpu 编译器支持。我建议使用 mobile_ssd 模型。
为了将来参考,您的管道应该是:
1) 训练模型
2) 转换为 tflite
3) 为 EdgeTPU 编译(实际将工作委托给 TPU 的步骤)
我想确定一下我为了获得yolov2-lite模型的tflite
而执行的以下步骤是否正确?
Step1 将图和权重保存到 protobuf 文件
flow --model cfg/yolov2-tiny.cfg --load bin/yolov2-tiny.weights --savepb
.
此命令使用 yolov2-tiny.pb 和 yolov2-tiny.meta.
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()
如果我按照上述步骤获取这个 tflite 是正确的,那么请建议我在 coral edge TPU USB 加速器中 运行 这个 tflite 文件的命令。
非常感谢:)
不幸的是,yolo 模型目前受 edgetpu 编译器支持。我建议使用 mobile_ssd 模型。
为了将来参考,您的管道应该是:
1) 训练模型
2) 转换为 tflite
3) 为 EdgeTPU 编译(实际将工作委托给 TPU 的步骤)