ERROR: ModelImporter.cpp:472 In function importModel

When i run deepstream app use onnx model (convert from keras model use keras2onnx) had error like under, how to slove it ?

ERROR: ModelImporter.cpp:472 In function importModel:
[4] Assertion failed: !_importer_ctx.network()->hasImplicitBatchDimension() && “This version of the ONNX parser only supports TensorRT INetworkDefinitions with an explicit batch dimension. Please ensure the network was created using the EXPLICIT_BATCH NetworkDefinitionCreationFlag.”

• Hardware Platform: Jetson Nano
• DeepStream 5.0
• JetPack Version 4.4
• TensorRT Version 7.1

Hi,

Please add the following properties:

[property]
...
#scaling-compute-hw=0
force-explicit-batch-dim=1
force-implicit-batch-dim=0

Thanks.

1 Like

Hi, after add this property, i receive waring and error

WARNING: [TRT]: onnx2trt_utils.cpp:220: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
ERROR: builtin_op_importers.cpp:1811 In function importLSTM:
[8] Assertion failed: std::equal(activationAlphas.begin(), activationAlphas.begin() + NUM_ACTIVATIONS, activationAlphas.begin() + NUM_ACTIVATIONS) && “The parser does not currently support cases where activations for the reverse pass of the LSTM do not match the forward pass.”

Hi, i have remove some layer, engine build successfully. thanks
But i have a problem about change color input.

0:02:17.800589032 12036 0x1cde4b20 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 2]: Error in NvDsInferContextImpl::preparePreprocess() <nvdsinfer_context_impl.cpp:874> [UID = 2]: RGB/BGR input format specified but network input channels is not 3

My model with shape input size: 82x40x1
Thanks

Hi,

Do you use grayscale input?
If yes, please update this property:

Gst-nvinfer File Configuration Specifications

Property Meaning Type and Range Example
model-color-format Color format required by the model Integer
0: RGB
1: BGR
2: GRAY
model-color-format=0

Thanks.

Hi, my model define input shape channel last

0 INPUT kFLOAT the_input 82x40x1

I had change property model-color-format = 2, And error is:

GRAY input format specified but network input channels is not 1

It seems that you open a new topic for this issue.
Please check the following status on Shape input layer issue about channel color directly.

Thanks.

1 Like