Darknet model to onnx
Asked Answered
C

2

6

I am currently working with Darknet on Yolov4, with 1 class.

I need to export those weights to onnx format, for tensorRT inference. I've tried multiple technics, using ultralytics to convert or going from tensorflow to onnx. But none seems to work. Is there a direct way to do it?

Chewink answered 1/7, 2020 at 8:50 Comment(0)
T
5

Check this GitHub repo: https://github.com/Tianxiaomo/pytorch-YOLOv4

Running the demo_darknet2onnx.py script you'll be able to generate the ONNX model from the .cfg and .weights darknet files.

Usage example:

python demo_darknet2onnx.py <cfgFile> <weightFile> <imageFile> <batchSize>

You can also decide the batch size for the inference calls of the converted model.

Trachytic answered 9/7, 2020 at 12:53 Comment(0)
B
2

The following repo exports yolov3 models from darknet to onnx, for tensorRT inference. You can use this as reference for your model.

https://github.com/jkjung-avt/tensorrt_demos/tree/master/yolo

Barite answered 1/7, 2020 at 9:11 Comment(2)
This link is no longer availableBalefire
I think it was renamed? Is it this? github.com/jkjung-avt/tensorrt_demos/tree/master/yoloDesirable

© 2022 - 2025 — McMap. All rights reserved.