Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6024 Discussions

Error while converting RetinaFace in Caffe to OpenVINO (2021.4.689)

Gouveia__César
New Contributor I
416 Views

Hello experts,

 

Before anything else, here is all the requirements to reproduce this error:

Version of the OpenVINO ToolKit used: OpenVINO 2021.4.689;

RetinaFace Caffe model used are in the attachments below (RetinaFace.rar); 

 

I had tried to convert RetinaFace model to IR OpenVINO format however the following error pops up:

(openvino_2021_4_689_py36) C:\Users\cesar.gouveia\Projects\openvino_2021.4.689>python deployment_tools\model_optimizer\mo.py --input_model C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\caffe_models\RetinaFace.caffemodel --input_shape (1,3,640,640) --output_dir C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\openvino_models
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\caffe_models\RetinaFace.caffemodel
- Path for generated IR: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\openvino_models
- IR output name: RetinaFace
- Log level: ERROR
- Batch: Not specified, inherited from the model
- Input layers: Not specified, inherited from the model
- Output layers: Not specified, inherited from the model
- Input shapes: (1,3,640,640)
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: None
- Reverse input channels: False
Caffe specific parameters:
- Path to Python Caffe* parser generated from caffe.proto: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\deployment_tools\model_optimizer\mo\utils\..\front\caffe\proto
- Enable resnet optimization: True
- Path to the Input prototxt: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\caffe_models\RetinaFace.prototxt
- Path to CustomLayersMapping.xml: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\deployment_tools\model_optimizer\mo\utils\..\..\extensions\front\caffe\CustomLayersMapping.xml
- Path to a mean file: Not specified
- Offsets for a mean file: Not specified
- Inference Engine found in: C:\Users\cesar.gouveia\Projects\openvino_2021.4.689\python\python3.6\openvino
Inference Engine version: 2021.4.1-3926-14e67d86634-releases/2021/4
Model Optimizer version: 2021.4.1-3926-14e67d86634-releases/2021/4
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.load.caffe.loader.CaffeLoader'>): Unexpected exception happened during extracting attributes for node face_rpn_cls_score_reshape_stride32.
Original exception message: 'ReshapeParameter' object is not subscriptable

 

This kind of error does not make sense because Reshape layer is a supported layer for Caffe in the OpenVINO supported layers page: https://docs.openvino.ai/latest/openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers.html

 

Moreover, in the attachments below there is the output of the modelOptimizer in DEBUG mode (ConversionOutput.txt).

I have tried convert this model with other versions of OpenVINO but without sucess. Have you guys seen these error message before? Any ideias or possible solutions for this problem?

 

Thanks,

César.

 

0 Kudos
2 Replies
Iffa_Intel
Moderator
388 Views

Hi,

 

I tried to convert your caffe model to IR by using the proto file but that failed too, which result to the same error as yours.

Probably your model is using unsupported topology. You may refer here to check the supported topology.

 

I recommend you to use the official OpenVINO model, retinaface-resnet50-pytorch which can be downloaded using the OpenVINO model downloader.

 

Command to download: python <omz_dir>/tools/downloader/downloader.py --name retinaface-resnet50-pytorch

 

Command to convert into IR: python <omz_dir>/tools/downloader/converter.py --name retinaface-resnet50-pytorch

 

This OpenVINO RetinaFace Demo might also help you.

 

 

 

Sincerely,

Iffa

 

 

Iffa_Intel
Moderator
367 Views

Greetings,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 


Sincerely,

Iffa


Reply