torch2trt_dynamic icon indicating copy to clipboard operation
torch2trt_dynamic copied to clipboard

load libtorch2trt_dynamic.so error

Open Chen-cyw opened this issue 4 years ago • 5 comments

I export the libtorch2trt_dynamic.so by "sudo python setup.py develop --plugins" and configure the trt and cuda path, but when I use the .so , it always get the error "OSError: libtorch2trt_dynamic.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv" did you try and finish the whole build&load process the "libtorch2trt_dynamic.so" I export, its size just 500kb. Then I get the "libtorch2trt.so" by the same way in the project(torch2trt) ,its size is 7.2Mb,which can load correctly

Chen-cyw avatar Nov 30 '20 10:11 Chen-cyw

--plugins flag is not used in this repo. Please install follow the README of this repo, not the official one.

grimoire avatar Nov 30 '20 11:11 grimoire

--plugins flag is not used in this repo. Please install follow the README of this repo, not the official one.

I config the setup.py like this: def initialize_plugins_options(cmd_obj): cmd_obj.plugins = True cmd_obj.cuda_dir = '/home/cyw/cuda-10.2' cmd_obj.torch_dir = None cmd_obj.trt_inc_dir = '/home/cyw/TensorRT-7.2.1.6/targets/x86_64-linux-gnu/include' cmd_obj.trt_lib_dir = '/home/cyw/TensorRT-7.2.1.6/targets/x86_64-linux-gnu/lib' any other things I need to do?

Chen-cyw avatar Nov 30 '20 11:11 Chen-cyw

Please follow these steps. you do NOT need to change anything inside setup.py, The plugin used in this repo is amirstan_plugin.

grimoire avatar Nov 30 '20 12:11 grimoire

Please follow these steps. you do NOT need to change anything inside setup.py, The plugin used in this repo is amirstan_plugin. thanks! I want to use the converted model by mmdetection-to-tensorrt in pure tensorrt env(later in tensorrt server), Is that I just need to load the "libamirstan_plugin.so" in tensortrt ? the torch2trt_dynamic is only for convert ,not for runtime?

Chen-cyw avatar Nov 30 '20 13:11 Chen-cyw

Yes, read this for detail.

grimoire avatar Nov 30 '20 14:11 grimoire