解决报错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。
posted @ 2018-10-26 19:59  EuniceFirewood  阅读(1491)  评论(0编辑  收藏  举报