【问题标题】:Keras does not use GPU on Pycharm having python 3.5 and Tensorflow 1.4 [duplicate]Keras不在具有python 3.5和Tensorflow 1.4的Pycharm上使用GPU [重复]
【发布时间】:2018-05-18 06:51:42
【问题描述】:
from tensorflow.python.client
import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
xx= get_available_gpus()
print('The GPU device is: ', xx)
print('Tensorflow: ', tf.__version__)`

这给了我以下输出。

Using TensorFlow backend.
2017-12-04 18:13:37.479189: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
The GPU device is:  []
Tensorflow:  1.4.0

我正在使用带有 python 3.5 的 Pycharm 社区版。 任何人都可以帮助解决如何强制使用 GPU。虽然在阅读文档时,我发现 Keras 自动使用 GPU。那么在我的情况下它不使用 GPU 的问题是什么? 正如一些问题中所建议的那样,我还尝试卸载 Tensorflow,但它仍然没有使用它。需要指导。

【问题讨论】:

    标签: tensorflow pycharm keras gpu


    【解决方案1】:

    我用Keras with TensorFlow backend not using GPU给出的答案解决了

    您需要同时卸载 tensorflow 和 tensorflow-gpu。然后重新安装 tensorflow-gpu。 如果两者都安装了,Keras 将只使用 CPU 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-27
      • 2019-04-27
      • 2019-06-09
      • 1970-01-01
      • 2018-08-16
      • 2018-05-07
      • 1970-01-01
      • 2020-08-11
      相关资源
      最近更新 更多