Skip to content

Commit a0d0865

Browse files
authored
Update README.md
1 parent 3aba354 commit a0d0865

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,25 @@ you can use darknet2pytorch to convert it yourself, or download my converted mod
212212
213213
Note:Errors will occur when using "pip install onnx-tf", at least for me,it is recommended to use source code installation
214214
215+
# 7. ONNX2TensorRT and DeepStream Inference
216+
217+
1. Compile the DeepStream Nvinfer Plugin
218+
```cd DeepStream
219+
make
220+
```
221+
2. Build a TRT Engine.
222+
For single batch,
223+
```trtexec --onnx=<onnx_file> --explicitBatch --saveEngine=<tensorRT_engine_file> --workspace=<size_in_megabytes> --fp16```
224+
225+
For multi-batch,
226+
```trtexec --onnx=<onnx_file> --explicitBatch --shapes=input:Xx3xHxW --optShapes=input:Xx3xHxW --maxShapes=input:Xx3xHxW --minShape=input:1x3xHxW --saveEngine=<tensorRT_engine_file> --fp16```
227+
228+
Note :The maxShapes could not be larger than model original shape.
229+
230+
3. Write the deepstream config file for the TRT Engine.
231+
232+
233+
215234
Reference:
216235
- https://github.com/eriklindernoren/PyTorch-YOLOv3
217236
- https://github.com/marvis/pytorch-caffe-darknet-convert

0 commit comments

Comments
 (0)