Problem Statement :
I am trying to convert an Yolov7 onnx model [yolov7-384x640-b1-silu.onnx - Google Drive] to tensorrt engine using the tensorrt.Builder with int8 caliberation. I am doing this on the two machines given below.
RTX3090 :
- trt : 8.6.1
- CUDA : 11.4
Jetson Orin Nano :
- trt : 8.5.2-1+cuda11.4
Here are the steps that I am following.
Approch 1:
-
Convert official yolov7.pt file to onnx using the following script. [yolov7/export.py at main · WongKinYiu/yolov7 · GitHub] . I am running it with the following arguments.
python export.py --weights yolov7.pt --grid --simplify --imgsz 384 640 --batch-size 1
-
Then I am running the following script to do the tensorrt conversion with int8 caliberation. [TensorRT-For-YOLO-Series/export.py at main · Linaom1214/TensorRT-For-YOLO-Series · GitHub]
python export.py -o yolov7.onnx -e yolov7.trt --end2end -p int8 --calib_input /path/to/calib/image/dir/
Approach2
-
Convert yolov7.pt to yolov7.onnx using the method mentioned above.
-
Converting yolov7.onnx to yolov7.trt using trtexec WITHOUT int8 caliberation.
/usr/src/tensorrt/bin/trtexec --onnx=yolov7.onnx --saveEngine=yolov7.engine --fp16 --int8
Results:
- Both Approach 1 and Approach 2 works well on my 3090 machine.
- On Jetson Orin Nano, Approach 1 will only work if we don’t do int8 caliberation, ie. it works fine for fp16 and fp32 trt models.
- Approach 2 works fine on both the machines.
ERROR
I am getting this error [check the log.txt for full log] when doing Approach 1 on Jetson orin nano when running this script.
python export.py -o yolov7.onnx -e yolov7.trt --end2end -p int8 --calib_input /path/to/calib/image/dir/
02/08/2024-12:25:30] [TRT] [E] 10: [optimizer.cpp::computeCosts::3728] Error Code 10: Internal Error (Could not find any implementation for node PWN(/model.0/act/Sigmoid).)
[02/08/2024-12:25:30] [TRT] [E] 2: [builder.cpp::buildSerializedNetwork::751] Error Code 2: Internal Error (Assertion engine != nullptr failed. )
My question is why I am getting a Could not find any implementation for node PWN(/model.0/act/Sigmoid), when clearly it is working for the fp16 mode and also on int8 mode using trtexec.
log.txt (387.7 KB)