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

error on converting tensorflow models into openvino bin/xml format

leo_yi
Employee
243 Views

I am trying to convert tensorflow model into openvino bin/xml format.

I met this error: [ FRAMEWORK ERROR ] Cannot load input model: No variables to save

 

Can anyone help on this, the following is my command line:

/home/leo/openvino/ovsrc/openvino/model-optimizer/mo.py --framework=tf --data_type=FP32 --output_dir=/home/leo/openvino/modelzoo/open_model_zoo-master/tools/downloader/public/resnet-50-tf/FP32 --model_name=resnet-50-tf '--input_shape=[1,224,224,3]' '--mean_values=[103.94.116.78.123.68]' --input_model=/home/leo/openvino/modelzoo/open_model_zoo-master/tools/downloader/public/resnet-50-tf/resnet_v1-50.pb --input_checkpoint=/home/leo/openvino/modelzoo/open_model_zoo-master/tools/downloader/public/resnet-50-tf/resnet_v1_50.ckpt --reverse_input_channels

 

 

0 Kudos
5 Replies
Peh_Intel
Moderator
203 Views

Hi Leo,


Thanks for reaching out to us.


For your information, if you download resnet-50-tf model using model_downloader , you will only get the .pb file.


On my side, I’ve validated that your command line works well without adding this argument:

 --input_checkpoint=/home/leo/openvino/modelzoo/open_model_zoo-master/tools/downloader/public/resnet-50-tf/resnet_v1_50.ckpt

 

 

Regards,

Peh


leo_yi
Employee
198 Views

Hi Peh

 

Thank your reply very much.

Yes, that ckpt file is what I added, the reason I add that is because if I only use the pb file, I tested the accuracy with MLPerf and Imagenet and find the accuracy is very low, only 1%. I don't know if the pb file is just the model structure or has the trained parameters, that is why I added the ckpt file.

What I thought is the pb file is just model structure and ckpt file contain the parameters. I don't know, do you think is that correct? 

 

I download that ckpt from this link:

https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_Convert_Mode...

 

 

Peh_Intel
Moderator
177 Views

Hi Leo,


Greetings to you.


Ckpt file only saves the weights of the variables or the graph and mainly used for resuming the training whereas pb file saves everything about the model including custom objects.


By referring to your previous command line, you have satisfied the minimum required arguments for the Model Optimizer to convert the TensorFlow model into IR format. However, there are also few missing arguments which might be the reason for getting low accuracy.


You may find all the required model_optimizer arguments in this file:

<installed_dir>\deployment_tools\open_model_zoo\models\public\

resnet-50-tf\model.yml


These information are also available here:

https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/resnet-50-tf/model.yml#L...


On the other hand, I would like to share with you an easier way to convert the TensorFlow model into IR format without specify all the arguments which is converter.py.


python “<installed_dir\deployment_tools\tools\model_downloader\converter.py” –-name resnet-50-tf



Regards,

Peh


Peh_Intel
Moderator
161 Views

Hi Leo,


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



Regards,

Peh


leo_yi
Employee
157 Views

Hi Peh

 

Thank you very much for help. The problem have been solved in my side.

 

Thanks

Leo

Reply