❓ [Question] Unknown type name '__torch__.torch.classes.tensorrt.Engine' #642
-
❓ Questionwhen I tried to load trt module which saved with python
I got this error
I linked libtrtorch.so as bellow
maybe I need to compile trt_module in c++ instead of python?? What you have already triedI can save trt_module and load and run with python without any problem Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This error occurs when you don't load the trtorch runtime. Make sure the libraries are properly linked in your program. One thing that is pretty common on the inference side if you aren't doing compilation is because you don't directly use any APIs from trtorch, compilers may silently ignore linking the library. Try linking the library with |
Beta Was this translation helpful? Give feedback.
-
thanks!
|
Beta Was this translation helpful? Give feedback.
This error occurs when you don't load the trtorch runtime. Make sure the libraries are properly linked in your program. One thing that is pretty common on the inference side if you aren't doing compilation is because you don't directly use any APIs from trtorch, compilers may silently ignore linking the library. Try linking the library with
-Wl,--no-as-needed
. Also if you aren't compiling the PyTorch model in C++ all you need to link islibtrtorchrt.so
which just had the runtime parts. It is a much smaller dependency than the full compiler library