Skip to content

Commit 4fa3758

Browse files
committed
a bit readme
1 parent 42eb265 commit 4fa3758

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tensorrt/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Then we can use either c++ or python to compile the model and run inference.
1515

1616
### Using C++
1717

18-
#### My platform
18+
#### 1. My platform
1919

2020
* ubuntu 18.04
2121
* nvidia Tesla T4 gpu, driver newer than 450.80
@@ -26,7 +26,7 @@ Then we can use either c++ or python to compile the model and run inference.
2626

2727

2828

29-
#### Build with source code
29+
#### 2. Build with source code
3030
Just use the standard cmake build method:
3131
```
3232
mkdir -p tensorrt/build
@@ -37,7 +37,7 @@ make
3737
This would generate a `./segment` in the `tensorrt/build` directory.
3838

3939

40-
#### Convert onnx to tensorrt model
40+
#### 3. Convert onnx to tensorrt model
4141
If you can successfully compile the source code, you can parse the onnx model to tensorrt model like this:
4242
```
4343
$ ./segment compile /path/to/onnx.model /path/to/saved_model.trt
@@ -49,21 +49,21 @@ $ ./segment compile /path/to/onnx.model /path/to/saved_model.trt --fp16
4949
Note that I use the simplest method to parse the command line args, so please do **Not** change the order of the args in above command.
5050

5151

52-
#### Infer with one single image
52+
#### 4. Infer with one single image
5353
Run inference like this:
5454
```
5555
$ ./segment run /path/to/saved_model.trt /path/to/input/image.jpg /path/to/saved_img.jpg
5656
```
5757

5858

59-
#### Test speed
59+
#### 5. Test speed
6060
The speed depends on the specific gpu platform you are working on, you can test the fps on your gpu like this:
6161
```
6262
$ ./segment test /path/to/saved_model.trt
6363
```
6464

6565

66-
#### Tips:
66+
#### 6. Tips:
6767
1. ~Since tensorrt 7.0.0 cannot parse well the `bilinear interpolation` op exported from pytorch, I replace them with pytorch `nn.PixelShuffle`, which would bring some performance overhead(more flops and parameters), and make inference a bit slower. Also due to the `nn.PixelShuffle` op, you **must** export the onnx model with input size to be *n* times of 32.~
6868
If you are using 7.2.3.4 or newer versions, you should not have problem with `interpolate` anymore.
6969

@@ -80,7 +80,7 @@ Likewise, you do not need to worry about this anymore with version newer than 7.
8080
You can also use python script to compile and run inference of your model.
8181

8282

83-
#### Compile model to onnx
83+
#### 1. Compile model to onnx
8484

8585
With this command:
8686
```
@@ -91,7 +91,7 @@ $ python segment.py compile --onnx /path/to/model.onnx --savepth ./model.trt --q
9191
This will compile onnx model into tensorrt serialized engine, save save to `./model.trt`.
9292

9393

94-
#### inference with Tensorrt
94+
#### 2. Inference with Tensorrt
9595

9696
Run Inference like this:
9797
```

0 commit comments

Comments
 (0)