Skip to content
Home » Assertion failed: mode == “constant” && value == 0.f && “This version of TensorRT only supports constant 0 padding!”

Assertion failed: mode == “constant” && value == 0.f && “This version of TensorRT only supports constant 0 padding!”

[01/18/2021-12:40:00] [W] [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:2191 In function importPad:
[8] Assertion failed: mode == “constant” && value == 0.f && “This version of TensorRT only supports constant 0 padding!”
[01/18/2021-12:40:00] [E] Failed to parse onnx file
[01/18/2021-12:40:00] [E] Parsing model failed
[01/18/2021-12:40:00] [E] Engine creation failed
[01/18/2021-12:40:00] [E] Engine set up failed

The above error occurs due to tensorrt version which supports only constant 0 padding in operation Pad.

  1. Try upgrading to latest version of tensorrt and run again.
  2. Convert the non-constant padding operations of the onnx model to constant 0 padding.

Also Read:

In function importPad: Assertion failed: inputs.at(1).is_weights()

Tags: