git clone https://github.com/mystic123/tensorflow-yolo-v3.git cd tensorflow-yolo-v3
以coco数据集训练的权重文件为例。python
下载coco.names。git
下载yolov3.weights或者yolov3-tiny.weights。github
YOLOv3:bash
python convert_weights.py --class_names coco.names --data_format NHWC --weights_file yolov3.weights
默认在当前文件夹下新建一个saved_model文件夹,里面是转换生成的文件:code
YOLOv3-tiny:orm
python convert_weights.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --tiny
YOLOv3:blog
python convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3.weights
默认在当前文件夹下生成一个pb文件:get
YOLOv3-tiny:源码
python convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --tiny
若是是转换本身训练的数据集,则将coco.names和yolov3.weights替换成本身相应的文件就能够了。it