0

当我使用 open vino 使用模型优化器将 .pb 文件转换为推理格式时,我一直面临“图形包含循环错误”。我们使用了 TensorFlow Object Detection Models 和 SSD Inception V2 来生成 .pb 文件。

[ 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.265/deployment_tools/model_optimizer/mo/main.py", line 222, in main
    return driver(argv)
  File "/opt/intel/computer_vision_sdk_2018.1.265/deployment_tools/model_optimizer/mo/main.py", line 190, in driver
    mean_scale_values=mean_scale)
  File "/opt/intel/computer_vision_sdk_2018.1.265/deployment_tools/model_optimizer/mo/pipeline/tf.py", line 141, in tf2nx
    partial_infer(graph)
  File "/opt/intel/computer_vision_sdk_2018.1.265/deployment_tools/model_optimizer/mo/middle/passes/infer.py", line 55, in partial_infer
    nodes = nx.topological_sort(graph)
  File "/opt/intel/computer_vision_sdk_2018.1.265/deployment_tools/model_optimizer/venv/lib64/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 ]  -------------------------------------------------
4

2 回答 2

0

我不熟悉模型优化器,但在 TensorFlow 图中有循环是完全正常的。如果你的模型有一个tf.while_loop地方,它的图就会有一个循环。我的猜测是 model_optimizer 的人不处理这样的模型。

于 2018-06-23T00:20:31.873 回答
0

使用以下参数执行命令:

python3 mo_tf.py --input_model <MODEL_PATH> --tensorflow_use_custom_operations_config <OPENVINO_DIR>/deployment_tools/model_optimizer/extensions/front/tf/faster_rcnn_support.json

然后 OpenVINO 将成功转换您的模型。查看此链接了解更多信息

于 2018-11-02T09:21:45.657 回答