解决报错Could not satisfy explicit device specification '' because the node was colocated with a group of nodes that required incompatible device '/device:GPU:0'
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
改为如下:
sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, log_device_placement=True))备注:allow_soft_placement=True表示
当没有GPU实现可用时,使用将允许TensorFlow回退到CPU。