The questions are as follows:
Invalidargumenterror (above for traceback): Cannot assign a device to node ' train/final/fc3/b/momentum ': Could not sat ISFY explicit device specification '/device:gpu:0 ' because no devices matching that specification are registered in this P rocess; Available devices:/job:localhost/replica:0/task:0/cpu:0
colocation Debug Info:
colocation Group had the Following types and devices: Applymomentum:cpu mul:cpu sum:cpu abs:cpu const:cpu Assign
: CPU
identity:cpu
variablev2:cpu
[[node:train/final/fc3/b/momentum = variablev2[_class=[' loc: @train/ Final/fc3/b "], container=" ", Dtype=dt_float, shape=[29], shared_name=" ", _device="/device:gpu:0 "] [)]]
Problem reason: some TF. Variable () is not allowed to run on the GPU and needs to run on the CPU
Solution: Modify the configuration inside the allow_soft_placement=true, and Allow_soft_placement=true, is running in the presence of the GPU is not allowed to run, you can switch to the CPU.
2017/8/9 20:20
After an afternoon of continuous debugging certification, found that allow_soft_placement=true, is in the GPU running program, automatically switch to the CPU, this way although to ensure the normal operation of the program, However, it is not guaranteed that the GPU problems can be timely feedback, so it is recommended to use the Allow_soft_placement=true option.