torch2trt
torch2trt copied to clipboard
TypeError: add_pooling_nd(): incompatible function arguments
Hello,
I'm trying to optimize an i3d anomaly detection model, but I'm getting this error:
File "run.py", line 89, in
This is the link to the i3d model I'm using: https://github.com/piergiaj/pytorch-i3d/blob/master/pytorch_i3d.py
The code in the link above contains classes and methods for creating the network's architecture. I don't know if the "incompatible function arguments" are caused by the way in which the network's architecture is being created, or if it's just the architecture itself, or something else.
To instantiate the model, I'm running:
from models.pytorch_i3d import InceptionI3d from torch2trt.torch2trt import torch2trt
model = InceptionI3d(400, in_channels=3) model.load_state_dict(torch.load(weights)) model.train(False) model.eval().to(device)
input_trt = [torch.ones((batch_size, 3, 16, 224, 224)).cuda()] trt_model = torch2trt(model, input_trt, max_batch_size=batch_size)
Now I'm only trying with batch_size = 1. The weights I'm using can be downloaded from this link: https://github.com/rtvad-ml/i3d-dev/blob/master/models/rgb_imagenet.pt
Thanks in advance.
just change the kernel_size to the (tuple, tuple) format in your model definition. It would work :D