| @@ -348,6 +348,9 @@ from google.protobuf.internal import api_implementation | |||||
| print(api_implementation.Type()) | 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 | ## Appendix | ||||
| ### TensorFlow Pb model exporting | ### TensorFlow Pb model exporting | ||||
| @@ -358,6 +358,10 @@ from google.protobuf.internal import api_implementation | |||||
| print(api_implementation.Type()) | print(api_implementation.Type()) | ||||
| ``` | ``` | ||||
| Q4. 使用.pb文件进行转换时,已确定`model_file`,`shape`,`input_nodes`,`output_nodes`均无误,并且环境中的依赖库已经正常安装,但是仍然报异常代码1000001,可能是什么原因? | |||||
| > 答:请检查生成该.pb文件所使用的TensorFlow版本不高于用于转换时安装的TensorFlow版本,避免由于旧版本TensorFlow无法解析新版本生成的.pb文件,而导致的模型文件解析失败。 | |||||
| ## 附录 | ## 附录 | ||||
| ### TensorFlow Pb模型导出 | ### TensorFlow Pb模型导出 | ||||
| @@ -28,7 +28,8 @@ class TFGraphParser(GraphParser): | |||||
| @classmethod | @classmethod | ||||
| @ModelLoadingError.check_except( | @ModelLoadingError.check_except( | ||||
| "Error occurs when loading model with given params, please check `--shape`, " | "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): | def parse(cls, model_path: str, **kwargs): | ||||
| """ | """ | ||||