NVIDIA-AI-IOT / torch2trt

An easy to use PyTorch to TensorRT converter
MIT License
4.55k stars 671 forks source link

Importing torch2trt hides tracebacks from exceptions #98

Open xsacha opened 4 years ago

xsacha commented 4 years ago

Just like title. Once I import torch2trt, I no longer get tracebacks from exceptions. It just tells me 'Segmentation Fault' for simple things such as 'File not found'. Simply removing the import fixes this.

jaybdub commented 4 years ago

Hi xsacha,

Thanks for reaching out.

I'm currently unable to reproduce this. Could you share more information regarding your system?

  1. Python version
  2. CPU/GPU

Or perhaps a minimal sample script to reproduce.

Best, John

xsacha commented 4 years ago

Python 3.6.8

import torch
from torch2trt import torch2trt

torch.load('file_does_not_exist.pt')

Segmentation fault

import torch

torch.load('file_does_not_exist.pt')

Traceback (most recent call last): File "ok.py", line 3, in torch.load('file_does_not_exist.pt') File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 381, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'file_does_not_exist.pt'

spolezhaev commented 4 years ago

+1, the same issue. Plus Segmentation fault (core dumped) is shown after the successful running of code.

BUAAtao commented 4 years ago

I have tried the Option 1 - Without plugins and Option 2 - With plugins (experimental). It would return "Segmentation fault" when I excuted "from torch2trt import torch2trt" .

alchemi5t commented 4 years ago

Any updates on this?

czs1886 commented 4 years ago

My environment is Centos 7.7.1908, python: 3.6.8, Cuda 10.1. I have successfully installed my torch2trt environment on Ubuntu and all the code can run without any problem. But when I install it on Centos, this problem occurs. There's no unknown symbol when I do ldd -r libtorchtrt.so.

DableUTeeF commented 2 years ago

Any update on this?

This problem is still there in the most recent version.