Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunny
Beginner
111 Views

Problem of converting tensorflow model to Intermediate Representation (IR)

System information (version)

  • OpenVINO => 2018.4.420
  • Operating System / Platform => Windows 
  • Framework => Tensorflow

 

Detailed description

Hi, I'm working on object detection using OpenVINO. However, I downloaded Inception Resnet tensorflow model (http://download.tensorflow.org/models/inception_resnet_v2_2016_08_30.tar.gz) and faced problem when converting this tensorflow model to Intermediate Representation (IR)  as follows. I tried other tensorflow model also faced same problem.

 

C:\xxx\OpenVino\inception_resnet_v2_2016_08_30>python C:\Intel\computer_vision_sdk_2018.4.420\deployment_tools\model_optimizer\mo_tf.py --input_meta_graph inception_resnet_v2_2016_08_30.ckpt
Model Optimizer arguments:
Common parameters:
        - Path to the Input Model:      None
        - Path for generated IR:        C:\xxx\OpenVino\inception_resnet_v2_2016_08_30\.
        - IR output name:       inception_resnet_v2_2016_08_30
        - 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
[ ERROR ]  -------------------------------------------------
[ ERROR ]  ----------------- INTERNAL ERROR ----------------
[ ERROR ]  Unexpected exception happened.
[ ERROR ]  Please contact Model Optimizer developers and forward the following information:
[ ERROR ]  __init__() got an unexpected keyword argument 'serialized_options'
[ ERROR ]  Traceback (most recent call last):
  File "C:\Intel\computer_vision_sdk_2018.4.420\deployment_tools\model_optimizer\mo\main.py", line 325, in main
    return driver(argv)
  File "C:\Intel\computer_vision_sdk_2018.4.420\deployment_tools\model_optimizer\mo\main.py", line 173, in driver
    ret_code = check_requirements(framework=argv.framework)
  File "C:\Intel\computer_vision_sdk_2018.4.420\deployment_tools\model_optimizer\mo\utils\versions_checker.py", line 136, in check_requirements
    exec("import {}".format(modules[name] if name in modules else name))
  File "<string>", line 1, in <module>
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py", line 59, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "C:\Users\milpr02\AppData\Roaming\Python\Python36\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 22, in <module>
    serialized_pb=_b('\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

[ ERROR ]  ---------------- END OF BUG REPORT --------------
[ ERROR ]  -------------------------------------------------

Please guide me how to solve this issue. 

Thank you very much.

 

Best regards,

Sunny

0 Kudos
1 Reply
Sunny
Beginner
111 Views

Hi, I have found the solution, it seems like the existing protocol buffers version in my machine not match with OpenVINO, so it showed the error.

I installed the anaconda, put "pip install -U protobuf" and it solved the issue.

Shared to all in case someone also face similar problem.

 

Best regards,

Sunny

Reply