Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6367 Discussions

Cannot handle this data type: (1, 1, 3), <f4 in Openvino Accuracy Checker

Ashwin_J_S
New Contributor I
1,768 Views

I am using a custom trained model which was  transfer learned on efficienetB0 ,I could convert it to fp32 and int8 versions, But when i use accuracy checker on it it was throwing the following message 

 

04:20:25 accuracy_checker ERROR: Cannot handle this data type: (1, 1, 3), <f4
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/Pillow-8.4.0-py3.8-linux-x86_64.egg/PIL/Image.py", line 2835, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 3), '<f4')

 

accuracy error.PNG

Labels (1)
0 Kudos
6 Replies
Iffa_Intel
Moderator
1,748 Views

Hi,

 

the EfficientnetB0 model pre-trained in TensorFlow is supported by OpenVINO.

You may refer here for more details.

 

Make sure you fed the correct input shape during the execution of Model Optimizer using the parameter --input_shape. (eg: [1,3,227,227] or (1,227,227,3) ).

The order of dimensions depends on the framework input layout of the model. For example, [N,C,H,W] is used for Caffe* models and [N,H,W,C] for TensorFlow* models.

 

Another thing to take note of is your model's channel order (BGR or RGB). You need to use the --reverse_input_channels if any change is required.

 

To understand better, you may refer :

When to Specify Input Shape

When to Reverse Input Channel

 

You should be able to test inferencing with your model using the OpenVINO Benchmark App.

 

Sincerely,

Iffa

 

 

 

 

0 Kudos
Ashwin_J_S
New Contributor I
1,742 Views

Hello @Iffa_Intel Thanks for replying , I tried both your methods , i.e tried giving input shapes and added reverse input channel , but unfortunately I am still facing the same error.

0 Kudos
Iffa_Intel
Moderator
1,726 Views

If possible, could you share your model files?.

Plus with your commands that you used with the Model Optimizer and accuracy checker.

Did you implement any custom layer to the model?



Sincerely,

Iffa


0 Kudos
Ashwin_J_S
New Contributor I
1,713 Views

The commands I used are

For model optimizer:

python3 /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py --input_model trained_model.onnx --output_dir ./ --input_shape [1,224,224,3] --reverse_input_channels

 

For accuracy checker :

accuracy_check -c /home/ubuntu/model.yaml -m /home/ubuntu/trained_model.xml -s /home/ubuntu/test_dataset -a /home/ubuntu/test_dataset/ --intermediate_metrics_results=True --metrics_interval=100 -td CPU

 

 

0 Kudos
Iffa_Intel
Moderator
1,703 Views

@Ashwin_J_S , I need both xml and bin file in order to try inferencing your model. Please help to share the bin file also.

 

 

 

Sincerely,

Iffa

0 Kudos
Iffa_Intel
Moderator
1,675 Views

Greetings,


Thank you for your question. If you need any additional information from Intel, please submit a new question as Intel is no longer monitoring this thread



Sincerely,

Iffa


0 Kudos
Reply