1

I'm following this guide to convert darknet to onnx. However, I'm facing the following error:

"C:\Users\Scott\Anaconda3\envs\pytorch_yolov4\lib\site-packages\torch\onnx\symbolic_helper.py", line 253, in _set_opset_version raise ValueError("Unsupported ONNX opset version: " + str(opset_version)) ValueError: Unsupported ONNX opset version: 11

What does this error mean and how to deal with it?

Scott
  • 4,974
  • 6
  • 35
  • 62
  • Can you open this file `C:\Users\Scott\Anaconda3\envs\pytorch_yolov4\lib\site-packages\torch\onnx\symbolic_helper.py` via some code editor (like visual studio code) and paste here lines 245 to 260? – theQuestionMan Nov 18 '20 at 03:45
  • 1
    @theQuestionMan, upgrading my pytorch version to 1.6.0 solved the issue. Thanks :) – Scott Nov 18 '20 at 06:35

1 Answers1

2

It looks like you have an old PyTorch version, probably PyTorch 1.2.

The docs here https://github.com/Tianxiaomo/pytorch-YOLOv4#4-pytorch2onnx recommend at least PyTorch 1.4.

Sergii Dymchenko
  • 6,890
  • 1
  • 21
  • 46
  • 1
    Yeah, upgrading was the solution. I upgraded pytorch version to 1.6.0 and now it's working fine. Thanks. – Scott Nov 18 '20 at 06:34