jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.74k stars 545 forks source link

Facing Issue with yolo to onnx conversion with pre-trained yolov3-tiny model. #608

Open NaveenVSeeWise opened 4 months ago

NaveenVSeeWise commented 4 months ago

I tried to follow and run the YOLO to ONNX conversion script, which is mentioned in the repository. However, I encountered an error, and I have provided more details below. Thank you!

Python version --> Python 2.7.17 Onnx version --> onnx==1.9.0 numpy version --> numpy==1.19.4

Error:

python3 yolo_to_onnx.py -m yolov3-tiny-288
Parsing DarkNet cfg file...
Building ONNX graph...
Traceback (most recent call last):
  File "yolo_to_onnx.py", line 1065, in <module>
    main()
  File "yolo_to_onnx.py", line 1053, in main
    verbose=True)
  File "yolo_to_onnx.py", line 590, in build_onnx_graph
    params)
  File "yolo_to_onnx.py", line 414, in load_resize_scales
    name, TensorProto.FLOAT, shape, data)
  File "/home/nano/.local/lib/python3.6/site-packages/onnx/helper.py", line 254, in make_tensor
    getattr(tensor, field).extend(vals)
TypeError: 1.0 has type numpy.float32, but expected one of: int, long, float