duan8/mobilenet/mobilenetv3
Phoenix b671024a27
Add Ghostnet && Fix object destruction order in APIToModel function to avoid undefined behavior (#1581)
* add ghostnet

* add ghostnet

* add ghostnetV1&ghostnetV2

* Fix object destruction order in APIToModel function to avoid undefined behavior

* Fix pre-commit errors in ghostnet/README.md

* Fix pre-commit errors

* Fix pre-commit errors in mobilenetV3

* Add a noqa marker in mobilenet py files
2024-10-09 18:48:03 +08:00
..
CMakeLists.txt Add Ghostnet && Fix object destruction order in APIToModel function to avoid undefined behavior (#1581) 2024-10-09 18:48:03 +08:00
logging.h Add Ghostnet && Fix object destruction order in APIToModel function to avoid undefined behavior (#1581) 2024-10-09 18:48:03 +08:00
mobilenet_v3.cpp Add Ghostnet && Fix object destruction order in APIToModel function to avoid undefined behavior (#1581) 2024-10-09 18:48:03 +08:00
mobilenet_v3.py Add Ghostnet && Fix object destruction order in APIToModel function to avoid undefined behavior (#1581) 2024-10-09 18:48:03 +08:00
README.md Add: AlexNet, MobileNetV3, DenseNet121 Python Network Definition API (#512) 2021-04-28 13:39:55 +08:00

mobilenet v3

MobileNetV3 architecture from "Searching for MobileNetV3" https://arxiv.org/abs/1905.02244?context=cs.

For the Pytorch implementation, you can refer to mobilenetv3.pytorch

Run

  1. generate mbv3_small.wts/mbv3_large.wts from pytorch implementation

  2. put mbv3_small.wts/mbv3_large.wts into tensorrtx/mobilenet/mobilenetv3

  3. build and run

cd tensorrtx/mobilenet/mobilenetv3
mkdir build
cd build
cmake ..
make
sudo ./mobilenetv3 -s small(or large) // serialize model to plan file i.e. 'mobilenetv3_small.engine'
sudo ./mobilenetv3 -d small(or large)  // deserialize plan file and run inference
  1. see if the output is same as pytorch side

TensorRT Python API

# 1. generate mobilenetv3.wts from [mobilenetv3.pytorch](https://github.com/chufei1995/mobilenetv3.pytorch)

# 2. put mobilenetv3.wts into tensorrtx/mobilenet/mobilenetv3

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

cd tensorrtx/mobilenet/mobilenetv3

python mobilenet_v2.py -s small(or large)  // serialize model to plan file i.e. 'mobilenetv2.engine'
python mobilenet_v2.py -d small(or large)  // deserialize plan file and run inference