torch2trt icon indicating copy to clipboard operation
torch2trt copied to clipboard

Process finished with exit code -1073741819 (0xC0000005)

Open pridexin opened this issue 2 years ago • 2 comments

After the environment configuration is complete, I try to run the Usage and get the following error:

CODE: import torch from torch2trt import torch2trt from torchvision.models.alexnet import alexnet

model = alexnet(pretrained=True).eval().cuda()

create example data

x = torch.ones((1, 3, 224, 224)).cuda()

convert to TensorRT feeding sample data as input

model_trt = torch2trt(model, [x])

CONSULE: Process finished with exit code -1073741819 (0xC0000005)

What is the reason for this?

pridexin avatar May 06 '22 11:05 pridexin

Hello, I also have the same question. I solve it through replacing "shape = tuple(self.context.get_binding_shape(idx))" to "shape= tuple(binding_shape[i] for i in range(len(binding_shape)))" in torch2trt.py in forward function. The reason is tuple transform not success. Maybe is connected by version.

sunshinesjw1 avatar Jul 01 '22 08:07 sunshinesjw1

In my case, the solution was updating pytorch version corresponding to CUDA used in TensorRT installation.

After the installation with CUDA 12.1, I forgot to change pytorch correctly. torch2.0.1+cu11.8 caused same issue in my CUDA 12.1 environment.

I hope it will be of help!

jseobyun avatar Jan 19 '24 02:01 jseobyun