Browse Source

Add FAQ and error info about using low version tensorflow to parse hight version pb file

pull/1303/head
moran 4 years ago
parent
commit
7565f63b6a
3 changed files with 9 additions and 1 deletions
  1. +3
    -0
      mindinsight/mindconverter/README.md
  2. +4
    -0
      mindinsight/mindconverter/README_CN.md
  3. +2
    -1
      mindinsight/mindconverter/graph_based_converter/third_party_graph/tf_graph_parser.py

+ 3
- 0
mindinsight/mindconverter/README.md View File

@@ -348,6 +348,9 @@ from google.protobuf.internal import api_implementation
print(api_implementation.Type())
```

Q4. While converting .pb file to MindSpore script, what may be the cause of error code 1000001 with ensuring `model_file`, `shape`, `iput_nodes` and `output_nodes` set right and third party requirements installed correctly?
> Answer: Make sure that the TensorFlow version to generate .pb file is no higher than that to convert .pb file, avoiding the conflict which caused by using low version TensorFlow to parse .pb file generated by high version one.

## Appendix

### TensorFlow Pb model exporting


+ 4
- 0
mindinsight/mindconverter/README_CN.md View File

@@ -358,6 +358,10 @@ from google.protobuf.internal import api_implementation
print(api_implementation.Type())
```

Q4. 使用.pb文件进行转换时,已确定`model_file`,`shape`,`input_nodes`,`output_nodes`均无误,并且环境中的依赖库已经正常安装,但是仍然报异常代码1000001,可能是什么原因?

> 答:请检查生成该.pb文件所使用的TensorFlow版本不高于用于转换时安装的TensorFlow版本,避免由于旧版本TensorFlow无法解析新版本生成的.pb文件,而导致的模型文件解析失败。

## 附录

### TensorFlow Pb模型导出


+ 2
- 1
mindinsight/mindconverter/graph_based_converter/third_party_graph/tf_graph_parser.py View File

@@ -28,7 +28,8 @@ class TFGraphParser(GraphParser):
@classmethod
@ModelLoadingError.check_except(
"Error occurs when loading model with given params, please check `--shape`, "
"`--input_nodes`, `--output_nodes`, `--model_file` or runtime environment integrity."
"`--input_nodes`, `--output_nodes`, `--model_file` or runtime environment integrity(please make sure "
"TensorFlow in current environment is consistent with the one used to export pb file). "
)
def parse(cls, model_path: str, **kwargs):
"""


Loading…
Cancel
Save