Model Optimizer command that changes the input shape to NCHW to convert an ONNX Faster R-CNN model to IR.
- Convert fasterRCNN-10.onnx model into IR using command:
python ./mo_onnx.py --input_model FasterRCNN-10.onnx --input_shape [3,960,960] --mean_values [102.9801,115.9465,122.7717] --transformations_config ./extensions/front/onnx/faster_rcnn.json
- Output:
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.AddMeanScaleValues.AddMeanScaleValues'>): Numbers of inputs and mean/scale values do not match.
- FasterRCNN-10.onnx model has CHW input shape.
- Add the --input "0:2" parameter to the Model Optimizer command to change input shape to NCHW:
python ./mo_onnx.py --input_model FasterRCNN-10.onnx --input_shape [3,800,800] --mean_values [102.9801,115.9465,122.7717] --transformations_config ./extensions/front/onnx/faster_rcnn.json --input "0:2"