【问题标题】:After switching from gpu to cpu in tensorflow with tf.device("/cpu:0") GPU undocks everytime tf is imported在使用 tf.device("/cpu:0") 在 tensorflow 中从 gpu 切换到 cpu 后,每次导入 tf 时 GPU 都会取消停靠
【发布时间】:2017-12-06 03:48:04
【问题描述】:

我使用的是 Windows 7。我在 tensorflow 中测试了我的 GPU,在 cpu 上已经测试过的模型上运行缓慢,我切换到 cpu:

tf.device("/cpu:0")

我假设我可以通过以下方式切换回 gpu:

tf.device("/gpu:0")

但是,当我尝试使用此配置重新运行时,我从 Windows 收到以下错误消息:

设备“NVIDIA Quadro M2000M”不是交换设备,无法移除。

我使用“nvida-smi”寻找我的 GPU,但系统说 GPU 不存在。

我重新启动了我的笔记本电脑,用“nvida-smi”测试了 GPU 是否存在并且 GPU 被识别。

我再次导入 tensorflow 并再次启动我的模型,但是弹出相同的错误消息并且我的 GPU 消失了。

其中一个 tensorflow 配置文件中的配置有问题吗?还是 Keras 文件?我可以改变什么来再次获得这项工作?你知道为什么 GPU 比 8 个 CPU 慢很多吗?

【问题讨论】:

    标签: tensorflow gpu cpu nvidia


    【解决方案1】:

    解决方案:重新安装 tensorflow-gpu 对我有用。

    但是仍然存在为什么会发生这种情况以及如何在 gpu 和 cpu 之间切换的问题?我不想使用第二个虚拟环境。

    【讨论】:

      猜你喜欢
      • 2017-11-14
      • 2012-07-03
      • 1970-01-01
      • 2017-03-30
      • 2018-12-07
      • 1970-01-01
      • 2012-10-31
      • 2020-04-12
      • 1970-01-01
      相关资源
      最近更新 更多