tensorflow gpu python3.5_Keras在具有python 3.5和Tensorflow 1.4的Pycharm上不使用GPU

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__)`

This gives me the following output.

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

I am using Pycharm community edition with python 3.5.

Can anybody help in fixing how one can enforce to use GPU. Although while reading the documentation, I have found that Keras use GPU automatically. So what is the problem in my case that it does not use GPU?

I also tried to uninstall Tensorflow, as suggested in some questions but still it does not use it. Need guidance.

解决方案

You need to uninstall both tensorflow and tensorflow-gpu. And than reinstall tensorflow-gpu.

If both are installed than Keras will use only CPU version.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值