[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected

Description


[TensorRT] ERROR: Parameter check failed at: …/builder/Layers.cpp::setInput::555, condition: mNetwork->hasExplicitPrecision() ? index <= 1 : index <= 0
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 44 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4
4 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 44 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4
4 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 44 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4
4 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 44 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4
4 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 44 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4
4 * 256 / 256 = 4096
[TensorRT] ERROR: Conv_24: kernel weights has count 0 but 4096 was expected
[TensorRT] ERROR: Conv_24: count of 0 weights in kernel, but kernel dimensions (4,4) with 256 input channels, 256 output channels and 256 groups were specified. Expected Weights count is 256 * 4*4 * 256 / 256 = 4096
ERROR: Failed to parse the ONNX file.
In node -1 (scaleHelper): UNSUPPORTED_NODE: Assertion failed: dims.nbDims == 4 || dims.nbDims == 5

when i convertsiamfcpp to tensorRT engine, I got this bug.
conv_24 is that blue node on the right,it use this right input as its filter,but it seems not works, has this happened to anyone?

Environment

TensorRT Version: 7.1.3
GPU Type:
Nvidia Driver Version:
CUDA Version:
CUDNN Version:
Operating System + Version: jetpack 4.5.1
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Hi @lee_gaojun,

We request you to share issue reproducible ONNX model and script/steps to try from our end for better assistance.
Meanwhile we also recommend you to try using trtexec.
For your reference,

Thank you.

It looks like conv does not support the input of two tensors. The kernel weight must be fixed otherwise the error will be reported.How should this situation be handled?

Hi @lee_gaojun,

TRT only support conv weights from ONNX initializer, we recommend you to change the model, do not use conv weights from dynamic input tensor.

Please refer following doc for python samples.
https://docs.nvidia.com/deeplearning/tensorrt/sample-support-guide/index.html#python_samples_section

Thank you.