marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.39k stars 344 forks source link

I followed the tutorial to execute python3 export_yoloV8.py -w yolov8n.pt -s 416 and the following error occurred #422

Open IronmanVsThanos opened 10 months ago

IronmanVsThanos commented 10 months ago

(yolov8) who@who-System-Product-Name:~/code/ultralytics$ python3 export_yoloV8.py -w yolov8n.pt -s 416 WARNING ⚠️ 'ultralytics.yolo.v8' is deprecated since '8.0.136' and will be removed in '8.1.0'. Please use 'ultralytics.models.yolo' instead. WARNING ⚠️ 'ultralytics.yolo.utils' is deprecated since '8.0.136' and will be removed in '8.1.0'. Please use 'ultralytics.utils' instead. Note this warning may be related to loading older models. You can update your model to current structure with: import torch ckpt = torch.load("model.pt") # applies to both official and custom models torch.save(ckpt, "updated-model.pt")

Starting: yolov8n.pt Opening YOLOv8 model

Ultralytics YOLOv8.0.152 🚀 Python-3.8.17 torch-1.10.0+cu102 CPU (Intel Core(TM) i7-10700 2.90GHz) YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients

Creating labels.txt file

Exporting the model to ONNX Traceback (most recent call last): File "export_yoloV8.py", line 122, in sys.exit(main(args)) File "export_yoloV8.py", line 90, in main torch.onnx.export(model, onnx_input_im, onnx_output_file, verbose=False, opset_version=args.opset, File "/home/who/anaconda3/envs/yolov8/lib/python3.8/site-packages/torch/onnx/init.py", line 316, in export return utils.export(model, args, f, export_params, verbose, training, File "/home/who/anaconda3/envs/yolov8/lib/python3.8/site-packages/torch/onnx/utils.py", line 107, in export _export(model, args, f, export_params, verbose, training, input_names, output_names, File "/home/who/anaconda3/envs/yolov8/lib/python3.8/site-packages/torch/onnx/utils.py", line 707, in _export _set_opset_version(opset_version) File "/home/who/anaconda3/envs/yolov8/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 849, in _set_opset_version raise ValueError("Unsupported ONNX opset version: " + str(opset_version)) ValueError: Unsupported ONNX opset version: 16

marcoslucianops commented 10 months ago

Try to set --opset 15 or lower.