duan8/resnet
2020-02-17 18:58:01 +08:00
..
CMakeLists.txt add resnext50_32x4d 2020-02-17 18:58:01 +08:00
common.h transfer from gitlab 2019-11-25 02:55:45 +08:00
README.md transfer from gitlab 2019-11-25 02:55:45 +08:00
resnet18.cpp transfer from gitlab 2019-11-25 02:55:45 +08:00
resnet50.cpp transfer from gitlab 2019-11-25 02:55:45 +08:00
resnext50_32x4d.cpp add resnext50_32x4d 2020-02-17 18:58:01 +08:00

resnet

ResNet-18 adn ResNet-50 model from "Deep Residual Learning for Image Recognition" https://arxiv.org/pdf/1512.03385.pdf

For the Pytorch implementation, you can refer to pytorchx/resnet

Following tricks are used in this resnet, nothing special, residual connection and batchnorm are used.

  • Batchnorm layer, implemented by scale layer.
// 1. generate resnet18.wts or resnet50.wts from [pytorchx/resnet](https://github.com/wang-xinyu/pytorchx/tree/master/resnet)

// 2. put resnet18.wts or resnet50.wts into tensorrtx/resnet

// 3. build and run

cd tensorrtx/resnet

mkdir build

cd build

cmake ..

make

sudo ./resnet18 -s   // serialize model to plan file i.e. 'resnet18.engine'
sudo ./resnet18 -d   // deserialize plan file and run inference

or

sudo ./resnet50 -s   // serialize model to plan file i.e. 'resnet50.engine'
sudo ./resnet50 -d   // deserialize plan file and run inference


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