I am trying to import an onnx model from pytorch, which has a conv layer, that takes tensors for both weights and inputs. Tensorrt fails to convert the model,
ERROR: /home/erisuser/p4sw/sw/gpgpu/MachineLearning/DIT/release/5.0/parsers/onnxOpenSource/builtin_op_importers.cpp:517 In function importConv:
[8] Assertion failed: inputs.at(1).is_weights()
failed to parse onnx file
Is this a problem with onnx importer, or Tensorrt?
If Tensorrt does not support such conv layers, is there an example of a custom layer that does this?
tensorrt should be able to parse cnn models.
to help us debug, can you share a small repor containing your conversion source, and onnx model that demonstrate the errors you are seeing?
can you also provide details on the platforms you are using?
Linux distro and version
GPU type
nvidia driver version
CUDA version
CUDNN version
Python version [if using python]
Tensorflow version
TensorRT version
./trtexec --onnx=model.onnx
onnx: model.onnx
----------------------------------------------------------------
Input filename: model.onnx
ONNX IR version: 0.0.3
Opset version: 9
Producer name: pytorch
Producer version: 0.4
Domain:
Model version: 0
Doc string:
----------------------------------------------------------------
While parsing node number 0 [Conv -> "2"]:
ERROR: /home/erisuser/p4sw/sw/gpgpu/MachineLearning/DIT/release/5.0/parsers/onnxOpenSource/builtin_op_importers.cpp:517 In function importConv:
[8] Assertion failed: inputs.at(1).is_weights()
failed to parse onnx file
Engine could not be created
Engine could not be created
I have also tried doing the same with Tensorrt 4, but got the same result.
I am using an Nvidia GTX 970 on ubuntu 16.04.
Any news from NVIDIA about this feature? I’m also trying to use a tensor as weight for a convolution. In which release this feature will be implemented?
As per the answer, TensorRT doesn’t currently support this. What I ended up doing is implementing those layers in cudnn separately. This approach seems to work fine, without much overhead.
Since I don’t have experience with CUDA / cuDNN programming nor with custom layers…
Does anyone (maybe @sergey.hovakimyan) have a guideline to follow?
I’m currently reading the docu but some hints in the context of the converter (onnx2trt or trtexec) would be nice.