Dynamic input shape is not supported so you can convert nodes with dynamic input to fixed using this command and then execute above snippet. Command:- python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param batch_size --dim_value 1 .\gfrg-v3-fp32-512x512.onnx .\fixed_gfrg-v3-fp32-512x512.onnx