-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export yolov4-large models to ONNX and inference with TensorRT #56
Comments
yolov4-csp convert onnx is support? Me really looking forward! |
@DaChaoXc Hello, yolov4-csp.weights can be exported to onnx model, using Yolov4/export_onnx.py and run:
inference can be done with:
|
@linghu8812 Hello ,I use https://github.com/CaoWGG/TensorRT-YOLOv4, the box is wrong, it seems the diffenence is yolo layer convert need add function of sigmoid? |
@linghu8812 something wrong ==> Context: Bad node spec: input: "115_convolutional_mish" input: "116_upsample_scale" output: "116_upsample" name: "116_upsample" op_type: "Resize" attribute { name: "mode" s: "nearest" type: STRING } |
solved ,onnx must 1.5.0 |
@DaChaoXc Hello, |
i changed the compute way, it works! data[0] = (row + sigmoid(input[begin_id]) * 2 - 0.5) * down_stride; |
@DaChaoXc yes, if add sigmoid op to onnx model, the sigmoid op will run with tensorrt, the code can be simplified as:
|
@DaChaoXc I have add export onnx model with opset 10 code, onnx version has been no longer a restriction. |
A yolov4-csp/p5/p6/p7-tensorrt project |
hey do you have code to export Scaled Yolov4 CSP version to Onnx ? @linghu8812 |
Hi, Could you update your code for the newest branch ? |
Hello everyone, here is a code that can convert the ScaledYOLOv4 model to onnx model.
yolov4-large branch
For the branch of yolov4-large, the code is here: https://github.com/linghu8812/tensorrt_inference/tree/master/ScaledYOLOv4, now it can support the conversion of yolov4-p5, yolov4-p6, yolov4-p7 models. After the model exported, a TensorRT inference code was supplied, the TensorRT inference results has been shown below, which was consistent with the PyTorch results.
yolov4-csp and yolov4-tiny branch
As for the darknet supportted models, please refer this issue: AlexeyAB/darknet#7002, it shows how to convert darknet models to ONNX models, now it has supported yolov4, yolov4x-mish, yolov4-tiny models and so on.
The text was updated successfully, but these errors were encountered: