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.

Model Optimizer --input_meta_graph conversion error

RAM_KUMAR__ARUN
Beginner
1,227 Views

Hai

During the conversion of rl_coach trained model using model optimizer i faced the below error.

sudo python3 /opt/intel/computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer/mo_tf.py --input_meta_graph /home/sslindia/coach/experiments/Atari_NEC/10_05_2019-11_10/checkpoint/0_Step-605.ckpt.meta
[sudo] password for sslindia:
Model Optimizer arguments:
Common parameters:
    - Path to the Input Model:     None
    - Path for generated IR:     /home/sslindia/coach/.
    - IR output name:     0_Step-605.ckpt
    - 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:     Not specified, inherited from the model
    - 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:     False
    - Reverse input channels:     False
TensorFlow specific parameters:
    - Input model in text protobuf format:     False
    - Offload unsupported operations:     False
    - Path to model dump for TensorBoard:     None
    - List of shared libraries with TensorFlow custom layers implementation:     None
    - Update the configuration file with input/output node names:     None
    - Use configuration file used to generate the model with Object Detection API:     None
    - Operations to offload:     None
    - Patterns to offload:     None
    - Use the config file:     None
Model Optimizer version:     1.4.292.6ef7232d
[ FRAMEWORK ERROR ]  Cannot load input model: Attempting to use uninitialized value main_level/agent/main/online/network_0/Variable
     [[{{node _retval_main_level/agent/main/online/network_0/Variable_0_22}}]]

 

Thanks

ARUN

0 Kudos
7 Replies
Shubha_R_Intel
Employee
1,227 Views

Dear RAM KUMAR, ARUN

 I am not sure what you mean by rl_coach trained model. A meta graph is a non-frozen graph. Can you try freezing your model using instructions similar to below ? After creating a frozen.pb please try again. To freeze your model you must know the hierarchical name of the output node (you can find this from Tensorboard).

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow.html#freeze-the-tensorflow-model

Thanks and hope it helps,

Shubha

0 Kudos
RAM_KUMAR__ARUN
Beginner
1,227 Views

Hai Shubha,

Thanks for the reply.

As you mentioned from the below topic

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow.html#freeze-the-tensorflow-model

I am Loading Non-Frozen Models to the Model Optimizer

using step 2:

MetaGraph:

In this case, a model consists of three or four files stored in the same directory:

model_name.meta

model_name.index

model_name.data-00000-of-00001 (digit part may vary)

checkpoint (optional)

To convert such TensorFlow model:

Go to the <INSTALL_DIR>/deployment_tools/model_optimizer directory

Run the mo_tf.py script with a path to the MetaGraph .meta file to convert a model:

python3 mo_tf.py --input_meta_graph <INPUT_META_GRAPH>.meta

at this stage i am facing the error mentioned in my previous post.

Also find the screenshot of model files generated from RL_coach

 

Thank

ARUN

 

 

0 Kudos
Shubha_R_Intel
Employee
1,227 Views

Dear RAM KUMAR, ARUN,

Those steps you posted above should theoretically work. But sometimes meta files do not work well with model optimizer.  Please see this forum post where meta files did not work for the poster but a frozen pb did. In order to freeze your meta file it's more convenient to use https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py . To use that tool however, you need to know specific output layers to chop off at.

Hope it helps,

Thanks,

Shubha

0 Kudos
yu__jia
Beginner
1,227 Views

Dear RAM KUMAR, ARUN,

Can you solve it? I have the same problem as you.

Thanks,

Jia

0 Kudos
Shubha_R_Intel
Employee
1,227 Views

Dear yu, jia,

I answered your question regarding how to find Tensorflow output node names in your previous post

Hope it helps,

Thanks,

shubha

 

0 Kudos
RAM_KUMAR__ARUN
Beginner
1,227 Views

No yu jia i cant able to resolve the issue

Thanks

ARUN

0 Kudos
Shubha_R_Intel
Employee
1,227 Views

Dear RAM KUMAR, ARUN

 We just released OpenVino 2019R2. did you try it ? Also can you kindly attach your model as a *.zip file to this ticket ?

Thanks !

Shubha

0 Kudos
Reply