duan8/lenet
irvingzhang0512 8cfc8ee03f
Support TSM-R50 Python API (#488)
* add tensorrt temporal shift module and related pytorch implementations

* add .gitignore and getn weights script.

* rename get_wts.py script

* Add tsm-r50 demo.

* update readme

* remove useless codes

* update readme

* update readme

* remote video and .gitignore, update tutorial

* update readme and tutorial

* fix a few bugs and test on tensorrt 5.1

* update readme
2021-04-18 16:30:25 +08:00
..
CMakeLists.txt lenet migrated to trt7 2020-11-06 23:39:13 +08:00
lenet.cpp fix lenet 2020-11-06 23:54:05 +08:00
lenet.py Support TSM-R50 Python API (#488) 2021-04-18 16:30:25 +08:00
logging.h fix 2020-11-06 23:39:30 +08:00
README.md add tensorrt python api sample for lenet (#476) 2021-04-14 15:34:57 +08:00

lenet5

lenet5 is the simplest net in this tensorrtx project. You can learn the basic procedures of building tensorrt app from API. Including define network, build engine, set output, do inference, serialize model to file, deserialize model from file, etc.

TensorRT C++ API

// 1. generate lenet5.wts from https://github.com/wang-xinyu/pytorchx/tree/master/lenet

// 2. put lenet5.wts into tensorrtx/lenet

// 3. build and run

cd tensorrtx/lenet

mkdir build

cd build

cmake ..

make

sudo ./lenet -s   // serialize model to plan file i.e. 'lenet5.engine'

sudo ./lenet -d   // deserialize plan file and run inference

// 4. see if the output is same as pytorchx/lenet

TensorRT Python API

# 1. generate lenet5.wts from https://github.com/wang-xinyu/pytorchx/tree/master/lenet

# 2. put lenet5.wts into tensorrtx/lenet

# 3. install Python dependencies (tensorrt/pycuda/numpy)

cd tensorrtx/lenet

python lenet.py -s   # serialize model to plan file, i.e. 'lenet5.engine'

python lenet.py -d   # deserialize plan file and run inference

# 4. see if the output is same as pytorchx/lenet