【发布时间】:2019-03-18 23:17:45
【问题描述】:
我正在尝试加载从 https://github.com/tensorflow/models/tree/master/official/resnet 获取的已训练模型,但是当我尝试加载 .pb 时,ParseFromString 方法出现错误:
import tensorflow as tf
from tensorflow.python.platform import gfile
GRAPH_PB_PATH = '../resnet_v2_fp32_savedmodel_NHWC/1538687283/saved_model.pb'
with tf.gfile.FastGFile(GRAPH_PB_PATH, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def, name="")
sess = tf.Session(graph=g_in)
DecodeError: Error parsing message
我做错了什么?
【问题讨论】:
标签: tensorflow machine-learning resnet