解决tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation

错误如下图所示:

在代码中添加如下两行即可:

config = tf.ConfigProto(allow_soft_placement = True)
sess = tf.Session(config = config)

猜你喜欢

转载自blog.csdn.net/tryeverything/article/details/85841651
今日推荐