ERROR: builtin_op_importers.cpp: In function importPad: Assertion failed: inputs.at(1).is_weights()
This error occurs mainly because of non-constant padding. The tensorrt supports only constant padding so try below methods:
- TensorRT should be updated to allow non-const pads (as per ONNX spec)
- If TensorRT is the conversion target, update tf2onnx to convert non-const pads to a composition of other operators with the same behaviour (Const of shape, concat). This could lead to performance concerns.
- Select fixed image dims as input and reconvert the model using those dims. I haven’t tried it, but the calculations should be able to be reduced to constants.
- Also try to solve the problem using ONNX-Simplifier.
Also Read:
ValueError: get tensor value: stack_Concat__28 must be Const