Description
I build Retinaface model from Pytorch → Onnx → TensorRT.
Firstly, i build .onnx with dynamic batch as follow
input_names = ["input"]
output_names = ["output"]
inputs = torch.randn(1, 3, args.long_side, args.long_side).to(device)
dynamic_axes = {
'input': {
0: 'batch_size'
},
'output': {
0: 'batch_size'
}
}
torch_out = torch.onnx._export(net,
inputs,
output_onnx,
export_params=True,
verbose=False,
input_names=input_names,
output_names=output_names,
dynamic_axes=dynamic_axes,
opset_version=11
)
Then i use trtexec command to generate engine files:
trtexec --onnx=Retinaface_m25_dynamic_batch.onnx --verbose --explicitBatch --minShapes=input:1x3x640x640 --optShapes=input:4x3x640x640 --maxShapes=input:8x3x640x640 --shapes=input:5x3x640x640 --saveEngine=./models/weights/retinaface.trt
I inference as follow in onnx_yolov3 python example in tensorrt repo and got this error:
[TensorRT] ERROR: Parameter check failed at: engine.cpp::resolveSlots::1318, condition: allInputDimensionsSpecified(routine)
i debug and it happen after this line:
context.execute_async(bindings=bindings, stream_handle=stream.handle)
I don’t know how to fix this problem. Plz help me.
Environment
TensorRT Version: tensorrt-7.2.3.4
GPU Type: T4
Nvidia Driver Version: 455.32
CUDA Version: 11.1
CUDNN Version: 8.0.5
Operating System + Version: Ubuntu 18.04
Python Version (if applicable): 3.7
PyTorch Version (if applicable): 1.9
Baremetal or Container (if container which image + tag):
Relevant Files
Steps To Reproduce
Please include:
- Exact steps/commands to build your repro
- Exact steps/commands to run your repro
- Full traceback of errors encountered