sub*_*bbu 6 python image-processing deep-learning tensorflow tensorboard
我正在训练模型并保存它,现在我尝试加载但无法执行。我也在之前的帖子中看到过,但是一些参考链接不起作用,或者我尝试了一些方法,仍然无法解决问题。
代码片段:
#load model
with tf.io.gfile.GFile(args.model, "rb") as f:
graph_def = tf.compat.v1.GraphDef()
graph_def.ParseFromString(f.read())
# with tf.Graph().as_default() as graph:
generated_image_1, generated_image_2, generated_image_3, = tf.graph_util.import_graph_def(
graph_def,
input_map={'input_image' : input_tensor, 'short_edge_1' : short_edge_1, 'short_edge_2' : short_edge_2, 'short_edge_3' : short_edge_3},
return_elements=['style_subnet/conv-block/resize_conv_1/output:0', 'enhance_subnet/resize_conv_1/output:0', 'refine_subnet/resize_conv_1/output:0'],
producer_op_list=None
)
Run Code Online (Sandbox Code Playgroud)
错误
Traceback (most recent call last):
File "stylize.py", line 97, in <module>
main()
File "stylize.py", line 57, in main
graph_def.ParseFromString(f.read())
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'
Run Code Online (Sandbox Code Playgroud)
注意:如果需要更多相关信息,请务必在此处添加。让我知道
归档时间: |
|
查看次数: |
11939 次 |
最近记录: |