0
變量我有下面的代碼:無法加載在Tensorflow
sess = tf.Session()
model_file = './runs/1488368349/checkpoints/model-42200.meta'
checkpoint_dir = './runs/1488368349/checkpoints/'
new_saver = tf.train.import_meta_graph(model_file)
#new_saver.restore(sess, MODEL_PATH)
new_saver.restore(sess, tf.train.latest_checkpoint(checkpoint_dir))
all_vars = tf.get_collection('vars')
print len(all_vars)
for v in all_vars:
v_ = sess.run(v)
print(v_)
但上面的代碼是無法加載變量。我得到的all_vars的長度爲0.
有人可以告訴我什麼是問題?