Use tensorrt to inference met error

[TensorRT] ERROR: INVALID_ARGUMENT: Cannot deserialize with an empty memory buffer.
[TensorRT] ERROR: INVALID_CONFIG: Deserialize the cuda engine failed.
Traceback (most recent call last):
File “”, line 90, in
File “”, line 82, in trt_infer
context = engine.create_execution_context()
AttributeError: ‘NoneType’ object has no attribute ‘create_execution_context’


The error indicates your buffer is empty.
In general, we deserialize TensorRT engine as following:

with open("xxx.plan", 'rb') as f:
    buf =
    engine = runtime.deserialize_cuda_engine(buf)

Could you double check if your do read the input data correctly first?

thank you ,i have solved the problem,my tensortrt is, i try to use onnx-smiplifier to smiplify onnx ,but i met the following error:
[E] [TRT] Network must have at least one output
[05/12/2021-14:11:34] [E] [TRT] Network validation failed.
[05/12/2021-14:11:34] [E] Engine creation failed
[05/12/2021-14:11:34] [E] Engine set up failed
but if i am not smiplify the onnx ,i could use convert onnx to tensorrt,


The error indicates TensorRT cannot find a valid output on your ONNX model.

Does the model follow the standard ONNX format after onnx-smiplifier?
And does it work by running TensorRT with the original ONNX format?

If yes, please do so.
TensorRT will merge and combine all the possible operations, so you can an optimized output directly.