【发布时间】:2016-08-19 13:55:44
【问题描述】:
我有以下设置:我在我们的 GPU 服务器上训练一个模型,使用 tf.train.Supervisor() 中的 tf.train.Saver() 功能保存一个检查点。训练后,我想将此模型传输到我的笔记本电脑并加载它以进行推理。
尝试使用self.saver.restore(sess,self.checkpoint_path) 恢复模型时(事先重新创建了正确的图表),我收到以下错误:
E tensorflow/core/client/tensor_c_api.cc:485] Cannot assign a device to node 'worker_0/save/Const': Could not satisfy explicit device specification '/job:worker/task:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
Colocation Debug Info:
Colocation group had the following types and devices:
Identity: CPU
Const: CPU
[[Node: worker_0/save/Const = Const[dtype=DT_STRING, value=Tensor<type: string shape: [] values: model>, _device="/job:worker/task:0"]()]]
分析返回的cpkt对象的属性时
cpkt = tf.train.get_checkpoint_state(self.checkpoint_dir)
我看到cpkt.model_checkpoint_path 指向服务器上创建检查点的原始路径,而不是指向我尝试从中恢复模型的self.checkpoint_path。
这两件事有联系吗?或者我上面的错误信息还有其他原因。
任何帮助将不胜感激,
垫子
【问题讨论】:
标签: tensorflow