Skip to content

Commit 34be473

Browse files
committed
2 parents 5274c98 + 759a525 commit 34be473

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ If you find an issue, please [let us know](../..//issues)!
1212
> Please note, this converter has limited coverage of TensorRT / PyTorch. We created it primarily
1313
> to easily optimize the models used in the [JetBot](https://github.com/NVIDIA-AI-IOT/jetbot) project. If you find the converter helpful with other models, please [let us know](../..//issues).
1414
15-
### Setup
15+
## Setup
1616

1717
```bash
1818
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
1919
cd torch2trt
20-
python setup.py install --user
20+
sudo python setup.py install
2121
```
2222

23-
### Usage
23+
> JetCam is tested against a system configured with the [JetCard](http://github.com/NVIDIA-AI-IOT/jetcard) setup. Different system configurations may require additional steps.
24+
25+
## Usage
2426

2527
Below are some usage examples, for more check out the [notebooks](notebooks).
2628

27-
#### Convert
29+
### Convert
2830

2931
```python
3032
from torch2trt import torch2trt
@@ -40,7 +42,7 @@ x = torch.ones((1, 3, 224, 224)).cuda()
4042
model_trt = torch2trt(model, [x])
4143
```
4244

43-
#### Execute
45+
### Execute
4446

4547
We can execute returned ``TRTModule`` just like the original PyTorch model
4648

@@ -52,7 +54,7 @@ y_trt = model_trt(x)
5254
print(torch.max(torch.abs(y - y_trt)))
5355
```
5456

55-
#### Save and load
57+
### Save and load
5658

5759
We can save the model as a ``state_dict``.
5860

@@ -70,7 +72,7 @@ model_trt = TRTModule()
7072
model_trt.load_state_dict(torch.load('alexnet_trt.pth'))
7173
```
7274

73-
### Models
75+
## Models
7476

7577
We tested the converter against these models using the [test.sh](test.sh) script. You can generate the results by calling
7678

@@ -104,7 +106,7 @@ bash test.sh TEST_OUTPUT.md
104106
| vgg19_bn | | | 51.4 | 121 |
105107

106108

107-
### How does it work?
109+
## How does it work?
108110

109111
This converter works by attaching conversion functions (like ``convert_ReLU``) to the original
110112
PyTorch functional calls (like ``torch.nn.ReLU.forward``). The sample input data is passed
@@ -117,7 +119,7 @@ uses this ``_trt`` to add layers to the TensorRT network, and then sets the ``_t
117119
relevant output tensors. Once the model is fully executed, the final tensors returns are marked as outputs
118120
of the TensorRT network, and the optimized TensorRT engine is built.
119121

120-
### How to add (or override) a converter
122+
## How to add (or override) a converter
121123

122124
Here we show how to add a converter for the ``ReLU`` module using the TensorRT
123125
python API.

0 commit comments

Comments
 (0)