【发布时间】:2019-07-09 05:22:43
【问题描述】:
我正在尝试在以下链接中加载预训练的 ResNet 模型 https://drive.google.com/open?id=1xkVK92XLZOgYlpaRpG_-WP0Elzg4ewpw
但它给出了 RuntimeError: The Session graph is empty。在调用 run() 之前向图中添加操作。
可能的问题是什么?
import tensorflow as tf
import tensorflow.contrib.slim as slim
# Let's load a previously saved meta graph in the default graph
# This function returns a Saver
saver = tf.train.import_meta_graph('model.ckpt-0.meta')
# We can now access the default graph where all our metadata has been loaded
graph = tf.get_default_graph()
with tf.Session(graph=tf.Graph()) as sess:
saver.restore(sess, 'model.ckpt-0.data-00000-of-00001')
print('Worked')
【问题讨论】:
标签: tensorflow resnet pre-trained-model