Browse Source

!1216 Check protobuf's backend in user environment

From: @lvyufeng
Reviewed-by: 
Signed-off-by:
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
50a4776d3e
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      mindinsight/mindconverter/graph_based_converter/framework.py

+ 7
- 0
mindinsight/mindconverter/graph_based_converter/framework.py View File

@@ -35,6 +35,8 @@ from mindinsight.mindconverter.common.exceptions import GraphInitError, TreeCrea
BadParamError
from mindinsight.mindconverter.graph_based_converter.third_party_graph import GraphFactory

from google.protobuf.internal import api_implementation

check_common_dependency_integrity = partial(check_dependency_integrity,
"onnx", "onnxruntime", "onnxoptimizer")

@@ -262,6 +264,11 @@ def main_graph_base_converter(file_config):
Args:
file_config (dict): The config of file which to convert.
"""
if api_implementation.Type() != 'cpp' \
or os.getenv('PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION') != 'cpp':
log_console.warning("Protobuf is currently implemented in \"Python\". \
The conversion process may take a long time. \
Please use the \"C++\" backend version")
graph_path = file_config['model_file']
frame_type = get_framework_type(graph_path)
if not file_config.get("shape"):


Loading…
Cancel
Save