我正在尝试将张量流图(.pb 文件)转换为.mlmodel
import tfcoreml
coreml_model = tfcoreml.convert(tf_model_path='optimized_model.pb', mlmodel_path='FaceImages.mlmodel', output_feature_names=['final_result'], input_name_shape_dict={'ResizeBilinear': {'images': None, 'size': {None, None}}}, minimum_ios_deployment_target='13')
但我收到以下错误:
/usr/local/lib/python3.6/dist-packages/coremltools/converters/nnssa/frontend/tensorflow/graphdef_to_ssa.py in load_tf_graph(graph_file)
21 with tf.io.gfile.GFile(graph_file, "rb") as f: 22 graph_def = tf.compat.v1.GraphDef()
---> 23 graph_def.ParseFromString(f.read())
24 25 # Then, we import the graph_def into a new Graph and returns it
DecodeError:解析消息时出错
有人可以帮忙吗?
这是colab 项目,我在其中附加了 tensorflow 模型和相关的转换代码
https://colab.research.google.com/drive/1S7nf7pnX15UuswFZaTih5pHhfDFwG5Xa