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=[220.127.116.11.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
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:
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:
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:
These information are also available here:
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
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.