Could not satisfy explicit device specification '/job:worker/task:0/device:GPU:1' because no support

来源:互联网 发布:php递归99乘法表 编辑:程序博客网 时间:2024/06/10 18:52

如上图报错,说gpu没有支持的kernel。原因是应为在tensorflow中,定义在图中的op,有的只能再cup中运行,gpu中不支持。解决方法就是让op自动识别,让它选择在合适的地方运行即可。如果op中有标识的话,在运行的时候指定在cup上执行,如果无法区分的话,可以试试在sess.run的时候加入allow_soft_placement=True。

例如:sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, log_device_placement=True))

亲测过,加上之后,就不报错。



阅读全文
0 0
原创粉丝点击