我跟随本教程将我自己训练过的tensorflow模型导出到c++,当我调用freeze_graph时会出现错误
I tensorflow/core/common_runtime/gpu/gpu_device.cc:838] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:03:00.0)
...
tensorflow.python.framework.errors.InvalidArgumentError: Cannot assign a device to node 'save/Const_1': Could not satisfy explicit device specification '/device:GPU:0' because no supported kernel for GPU devices is available.
Colocation Debug Info:
Colocation group had the following types and devices:
Identity: CPU
Const: CPU
[[Node: save/Const_1 = Const[dtype=DT_STRING, value=Tensor<type: string shape: [] values: model>, _device="/device:GPU:0"]()]]
Caused by op u'save/Const_1', defined at:
...GPU:0是由Tensorflow检测和使用的,所以我不知道错误是从哪里来的。
知道吗?
发布于 2016-10-05 16:15:04
这个错误意味着op save/Const_1试图被放置在GPU上,并且没有该节点的GPU实现。事实上,Const节点仅仅是CPU,并且作为图形对象的一部分存储,所以不能放在GPU上。一个解决方案是使用allow_soft_placement=True运行,或者打开pbtxt文件并手动删除该节点的device行。
https://stackoverflow.com/questions/39878698
复制相似问题