torch.save(model_trt.state_dict(),'alexnet_trt.pth') We can load the saved model into aTRTModule fromtorch2trt_dynamicimportTRTModule model_trt = TRTModule() model_trt.load_state_dict(torch.load('alexnet_trt.pth')) Setup To install without compiling plugins, call the following ...
A pytorch to tensorrt convert with dynamic shape support - torch2trt_dynamic/setup.py at master · grimoire/torch2trt_dynamic
git clone https://github.com/grimoire/torch2trt_dynamic.git torch2trt_dynamic cd torch2trt_dynamic pip install . Set plugins(optional) Some layers such as GN need c++ plugins. Install the plugin project below amirstan_plugin DO NOT FORGET to export the environment variable AMIRSTAN_LIBRARY_PA...
20 changes: 6 additions & 14 deletions 20 torch2trt_dynamic/plugins/__init__.py Original file line numberDiff line numberDiff line change @@ -1,33 +1,25 @@ from .create_adaptivepool_plugin import create_adaptivepool_plugin from .create_dcn_plugin import create_dcn_plugin from .create_...