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.
6403 Discussions

Unable to convert Efficientdet model trained on custom dataset to IR models.

dilip96
New Contributor I
2,144 Views

I have a Efficientdet model trained on my custom dataset. 

OpenVINO version 2021.1
Tensorflow 2.4.0

The command used to convert to IR models:-

!python3 mo.py --saved_model_dir /content/fine_tuned_model/saved_model/ --transformations_config /opt/intel/openvino_2021/deployment_tools/model_optimizer/extensions/front/tf/automl_efficientdet.json --input_shape [1,300,300,3] --reverse_input_channels
 
Below is the error I am facing:-
 
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.load.tf.loader.TFLoader'>): Unexpected exception happened during extracting attributes for node Const_30. Original exception message: 'ascii' codec can't decode byte 0xfd in position 183: ordinal not in range(128)
I have attached the complete error in error.txt file. PFA.
 
Also I have uploaded a zip file of my model "fine_tuned_model.zip"

Please give me a solution for this error. 

Thank you in advance.
 
Labels (6)
0 Kudos
5 Replies
AndrewG_Intel
Employee
2,129 Views

Hello @dilip96

Thank you for posting on the Intel® communities.


We noticed that this is regarding Intel® OpenVINO™. We have a forum for those specific products and questions so we are moving it to the Intel® Distribution of OpenVINO™ Toolkit Forum so it can get answered more quickly.


Best regards,

Andrew G.

Intel Customer Support Technician


0 Kudos
Munesh_Intel
Moderator
2,114 Views

Hi Dilip,

Thanks for reaching out to us. I don't find any attachments with this thread. Could you please reattach your files for us to have a look?


Additionally, for your information, the error 'ascii' codec can't decode byte generally happens when you try to convert a Python 2.x str that contains non-ASCII to a Unicode string without specifying the encoding of the original string.


Regards,

Munesh


0 Kudos
Dexter_F
Beginner
2,097 Views

I too am facing a similar issue. I have trained an efficientdet-d0 model on my custom dataset.

OpenVINO version 2021.1
Tensorflow 2.4.0

Before conversion, within the automl_efficientdet.json file, I changed the value of 'num_classes' from 90 to 9 to reflect the custom objects my model has to detect.

I used the following command to convert my .pb model to IR format:

python /home/dexter/ML/openvino/model-optimizer/mo.py --input_model savedmodeldir-custom_512/efficientdet-d0_frozen.pb --transformations_config /home/dexter/ML/openvino/model-optimizer/extensions/front/tf/automl_efficientdet.json --input_shape "[1, 512, 512, 3]"

This is the error message that is generated:

[ ERROR ] Cannot infer shapes or values for node "Reshape".
[ ERROR ] Number of elements in input [ 1 64 64 81] and output [1, 3686, 90] of reshape node Reshape mismatch
[ ERROR ]
[ ERROR ] It can happen due to bug in custom shape infer function <function Reshape.infer at 0x7fd475b0dc20>.
[ ERROR ] Or because the node inputs have incorrect values/shapes.
[ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): Stopped shape/value propagation at "Reshape" node.

I have uploaded my model in .pb format as well as the config.yaml file that I used during training. The error messages produced from setting log_level=DEBUG are also present.

Thanks in advance.

0 Kudos
Munesh_Intel
Moderator
2,073 Views

Hi Dexter,

Thanks for reaching out to us. Since yours is a different use case, please open a new thread for us to better serve you.


Regards,

Munesh



0 Kudos
Munesh_Intel
Moderator
2,037 Views

Hi Dilip,

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


Regards,

Munesh


0 Kudos
Reply