dynamic input (or layer) shape does not work with opencv. Dynamic means at inference time.
But with onnx model if input is dynamic you can set input shape :
- simplify model
onnxsim a.onnx a.sim.onnx
- use netron to know input and name shape
- fixed input shape using
python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param batch --dim_value 1 a.sim.onnx a1.onnx
python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param width --dim_value 640 a1.onnx a2.onnx
python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param height --dim_value 480 a2.onnx a3.onnx
Sometimes data input layer are dynamic then post an issue