Conversion from pytorch to tensorrt

The process is getting terminated with a killed message when i am trying to convert pytorch model to tensorrt on jetson nano.

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

create some regular pytorch model…

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

create example data

x = torch.ones((1, 3,224, 224)).cuda()
print(‘loaded’)

convert to TensorRT feeding sample data as input

model_trt = torch2trt(model, )
print(‘done’)
print(model_trt)

When I am trying to run this, the process is getting killed during this line torch2trt(model, ). Not only this but when I tried to run the sample tutorial in TensorRT sample support guide : https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html#network_api_pytorch_mnist
The same thing happened. It got terminated with killed message. Can anyone help me in converting pytorch model to tensorrt?

Hi Surya,

I am having the same problem. Did you find any solution for this?