tensorrt inference error while load onnx model

Hi,

TensorRT only supports FP32, FP16, INT32, and INT8: https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/python_api/infer/FoundationalTypes/DataType.html#tensorrt.DataType

UINT8 is not supported as mentioned there. Can you try to use int8 or int32 instead of uint8 before converting your model to ONNX?

Alternatively, you could try to use the ONNX API to convert the UINT8 nodes to INT8 or INT32 after training/converting to ONNX, but these could potentially create incorrect results if not handled properly.

For example, the range of UINT8 is [0, 255], and INT8 is [-127, 128], so if you just converted UINT8->INT8, those values between [128-255] may propogate incorrectly through the network after being casted. INT32 might be a safer bet as it will cover the range of UINT8 (and more).

However, if the casting to INT8/INT32 was done in the original DL framework before training time, the model would likely be fine with this, as it would be trained/learn with these types.