-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [Bug] An wrong function call for torch._C._jit_to_tensorrt
on spec
in tutorial code.
#286
Comments
It seems like to me there might be some confusing variable names. trt_model = torch._C._jit_to_tensorrt(script_model._c, {'forward': spec})
trt_model = torch._C._jit_to_tensorrt(script_model._c, spec) as shown in the documentation (https://nvidia.github.io/TRTorch/tutorials/use_from_pytorch.html). It would probably be a good idea to change the name of one of these to avoid confusion. |
Let me add one comment about It is defined like below therefore current Is that expected? |
to_backend Also fixes nested dictionary bug reported in #286 Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
Yeah there was an issue with an expected nested dict. It should be fixed now in master. Note the API in PyTorch has changed in 1.7 to |
Bug Description
This is a bug in a tutorial below.
To compile a model,
torch._C._jit_to_tensorrt()
is called with two parameters,script_model._c
andspec
.But, a following error happened.
This error looks like caused by wrong parameter. In test code (https://github.com/NVIDIA/TRTorch/blob/b93627ecc7bb7123d2e32aff9d762dd0e6bc3166/tests/py/test_to_backend_api.py), this API is called with a different parameter like below. It looks like making additional
dict
withforward
key is necessary.To Reproduce
Steps to reproduce the behavior:
nvcr.io/nvidia/tensorrt:20.03-py3
.pip install https://github.com/NVIDIA/TRTorch/releases/download/v0.1.0/trtorch-0.1.0-cp36-cp36m-linux_x86_64.whl torchvision==0.7.0
My repro code is below. Note that I modified the tutorial code to use FP32 for test.
Expected behavior
No exception.
Environment
conda
,pip
,libtorch
, source): pipAdditional context
N/A
The text was updated successfully, but these errors were encountered: