NVIDIA-AI-IOT / torch2trt

An easy to use PyTorch to TensorRT converter
MIT License
4.62k stars 677 forks source link

[TensorRT] ERROR: Internal error: could not find any implementation for node (Unnamed Layer* 202) [Deconvolution], try increasing the workspace size with IBuilder::setMaxWorkspaceSize() #36

Closed ShreyasSkandanS closed 5 years ago

ShreyasSkandanS commented 5 years ago
[TensorRT] ERROR: Internal error: could not find any implementation for node (Unnamed Layer* 202) [Deconvolution], try increasing the workspace size with IBuilder::setMaxWorkspaceSize()
[TensorRT] ERROR: ../builder/tacticOptimizer.cpp (1230) - OutOfMemory Error in computeCosts: 0

I have a network (based on ERFNet) and some trained weights for this model. I'm trying to convert it from PyTorch to TensorRT and I do the following:

import torch
from torch2trt import torch2trt
import pdb

from NETWORK_DESIGN import Net
NUM_CLASSES = X
model = Net(NUM_CLASSES)
model_url = torch.load("/path/to/model/model_best.pth")
model.load_state_dict(model_url, strict=False)
model.cuda().half().eval()
x = torch.ones((1, 3, WIDTH, HEIGHT)).cuda().half()
model_trt = torch2trt(model, [x], fp16_mode=True)
pdb.set_trace()

But I get the above error. Is there an unsupported layer in here somewhere? I don't believe there to be any fancy layers in this architecture. I'm happy to share both the network design and weights files. I tested this both on my Laptop (MX150) and a Jetson Xavier (Jetpack 4.2).

The network was trained using PyTorch 1.1.

jaybdub commented 5 years ago

Hi ShreyasSkandanS,

Thanks for reaching out. Could you share the version of TensorRT you are using?

Also, can provide the PyTorch model you're using? Sometimes the solution can be a bit nuanced.

The trained weights likely aren't necessary.

Best, John

ShreyasSkandanS commented 5 years ago

I would prefer to share the model + weights offline, if that is possible?

jaybdub commented 5 years ago

Sure, jwelsh@nvidia.com

ShreyasSkandanS commented 5 years ago

Silly me, I believe I just reached out to you.

ShreyasSkandanS commented 5 years ago

Solved.

allenling commented 5 years ago

i got same problem, any help?

pwr617 commented 5 years ago

i got same problem, any help?

jaybdub commented 5 years ago

Hi all,

I believe the solution was to increase max workspace size. You can do this by setting max_workspace_size parameter. For example

‘’model_trt = torch2trt(model, [data], max_workspace_size=1<<25)’’

Should work.

Best, John

BurkeyLai commented 4 years ago

Hi all,

I believe the solution was to increase max workspace size. You can do this by setting max_workspace_size parameter. For example

‘’model_trt = torch2trt(model, [data], max_workspace_size=1<<25)’’

Should work.

Best, John

This answer really help me a lot. Thanks!