我多次训练神经网络,然后尝试一次加载多个副本。但是得到
tensorflow.python.framework.errors_impl.NotFoundError: Key indics_conv/conv0_2_0/w/Adam not found in checkpoint
[[Node: save/RestoreV2_34 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_34/tensor_names, save/RestoreV2_34/shape_and_slices)]]
即使我尝试从相同的文件加载。保存加载是在同一Python类中进行的。区别在于,在一个实例内部是以这种方式创建的
self.sess = tf.InteractiveSession(config=tf.ConfigProto(gpu_options=gpuOptions))
self.initTfObjects()
tf.global_variables_initializer().run(session=self.sess) # Don't remember why this is made only for the main copy. But doing for the secondary too doesn't help
和第二个-
graph = tf.Graph()
self.sess = tf.Session(graph=graph, config=tf.ConfigProto(gpu_options=gpuOptions))
with graph.as_default():
self.initTfObjects()
保存:
self.tfSaver = tf.train.Saver(max_to_keep=10000)
self.tfSaver.save(self.sess, fileName)
正在加载:
self.tfSaver.restore(self.sess, fileName)
我缺少某些方面吗?这以前对我有用。
TensorFlow 1.4.0,Python 3.5.2 x64,Windows 7