[英]Error converting tensorflow .pb model to .mlmodel
我正在嘗試將張量流圖( .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
解碼錯誤:解析消息時出錯
有人可以幫忙解決這個問題嗎?
這是colab 項目,我在其中附加了 tensorflow 模型和相關的轉換代碼
https://colab.research.google.com/drive/1S7nf7pnX15UuswFZaTih5pHhfDFwG5Xa
您是否檢查過您使用的 Tensorflow 版本與這些庫兼容? 這只是一個猜測,但你可以嘗試運行
!pip install tensorflow --upgrade
在筆記本的頂部,看看它是否解決了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.