【发布时间】: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