@ersheng Thanks a lot. I try this way and it works!
But there seems have some wrong about results.
And it returns warning info.
WARNING: …/nvdsinfer/nvdsinfer_func_utils.cpp:34 [TRT]: Explicit batch network detected and batch size specified, use enqueue without batch size instead.
Implements
I change the input size to width=320 height=512
And get onnx from Darknet but not pytorch. And set batchsize=1 using this command:
python demo_darknet2onnx.py yolov4.cfg yolov4.weights ./data/dog.jpg 1
onnx2tensorrt
trtexec --onnx=yolov4_1_3_512_320.onnx --explicitBatch --saveEngine=yolov4_1_3_320_512_fp16.engine --workspace=4096 --fp16
Questions
When I set batchsize=4, it gives errors and quit. Does the batchsize have be 1 and input size 320*512? Must I use the Pytorch model? Can the workflow be darknet → ONNX → TensoRT?