[yolov5s → onnx] runnned in google colab
Expand Table
1

!python /content/drive/MyDrive/yolov5/models/export.py --train --weights /content/drive/MyDrive/yolov5/runs/yolov5_results6/weights/best.pt --img 512 --batch 1

cs 48

[onnx → tensorflow representation → pb folder]


1
2
3
4
5
6



import onnx

from onnx_tf.backend import prepare
 
onnx_model = onnx.load(r'test\convert_pt_to_tf\weights\best2.onnx')  # load onnx model

tf_rep = prepare(onnx_model)  # prepare tf representation

tf_rep.export_graph(r'test\convert_pt_to_tf\best2_pb')  # export the model


cs 48

[pb folder → tensorflow model]


1
2
3



import tensorflow as tf
 
pb_model = tf.keras.models.load_model(r'best2_pb')

cs 48