intel-iot-devkit / smart-video-workshop

Learn about the workflow using Intel® Distribution of OpenVINO™ toolkit to accelerate vision, automatic speech recognition, natural language processing, recommendation systems and many other applications.
304 stars 176 forks source link

Error while trying to use the optimizer for tensorflow #4

Closed ravi-ilango closed 6 years ago

ravi-ilango commented 6 years ago

I am trying to use the optimizer to create an optimized IR using the following command.

sudo python3 mo_tf.py --input_model ~/Downloads/ssd_inception_v2.pb -o $SV/object-detection/inception_v2-ssd/FP32 --scale 256 --mean_values [127,127,127]

I got the following Error. I tried another tensor flow model and got the same error.

[ ERROR ] ------------------------------------------------- [ ERROR ] ----------------- INTERNAL ERROR ---------------- [ ERROR ] Unexpected exception happened. [ ERROR ] Please contact Model Optimizer developers and forward the following information: [ ERROR ] Graph contains a cycle. [ ERROR ] Traceback (most recent call last): File "/opt/intel/computer_vision_sdk_2018.1.249/deployment_tools/model_optimizer/mo/main.py", line 222, in main return driver(argv) File "/opt/intel/computer_vision_sdk_2018.1.249/deployment_tools/model_optimizer/mo/main.py", line 190, in driver mean_scale_values=mean_scale) File "/opt/intel/computer_vision_sdk_2018.1.249/deployment_tools/model_optimizer/mo/pipeline/tf.py", line 141, in tf2nx partial_infer(graph) File "/opt/intel/computer_vision_sdk_2018.1.249/deployment_tools/model_optimizer/mo/middle/passes/infer.py", line 55, in partial_infer nodes = nx.topological_sort(graph) File "/home/ubuntu/.local/lib/python3.5/site-packages/networkx/algorithms/dag.py", line 157, in topological_sort raise nx.NetworkXUnfeasible("Graph contains a cycle.") networkx.exception.NetworkXUnfeasible: Graph contains a cycle.

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

priyanka-bagade commented 6 years ago

Converting a Tensor flow model using Model Optimizer is slightly different than the caffe model conversion. You will need to freeze the TF model first and then pass it through model optimizer. We are working on putting the TF tutorial. It will be up on the github very soon. Stay connected.

ravi-ilango commented 6 years ago

Hi Priyanka,

 I am doing some tests on performance improvement for a TensorFlow model (on a cpu with and without OpenVINO).   Do you have this tutorial available now.  Greatly appreriate your answer.

thanks

priyanka-bagade commented 6 years ago

yes, the tutorial is available under Advanced video analytics section.

ravi-ilango commented 6 years ago

Thanks! I used the tutorial.