离线安装keras linux gpu,使用GPU而不是CPU与Keras搭配使用Tensorflow后端的Linux

我无法使Keras使用GPU版本的Tensorflow而不是CPU。每次我进口keras它只是说:使用GPU而不是CPU与Keras搭配使用Tensorflow后端的Linux

>>> import keras

Using TensorFlow backend

......这意味着它的工作,但在CPU上,而不是GPU。 我安装CUDA和cuDNN和使用环境:

conda create -n tensorflow python=3.5 anaconda

我觉得我第一次安装tensorflow的CPU版本 - 我不记得了,因为我整天刚开CUDA和cudnn工作。 不管怎样,我安装的是GPU版本太多:

pip install --ignore-installed --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-linux_x86_64.whl

,它仍然给出了同样的消息。我试图检查正在使用的设备由下面的代码:

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

,但我得到这个输出,说明我使用的设备0,我的GPU:

2017-05-12 02:14:10.746679: W

tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow

library wasn't compiled to use SSE4.1 instructions, but these are

available on your machine and could speed up CPU computations.

2017-05-12 02:14:10.746735: W

tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow

library wasn't compiled to use SSE4.2 instructions, but these are

available on your machine and could speed up CPU computations.

2017-05-12 02:14:10.746751: W

tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow

library wasn't compiled to use AVX instructions, but these are

available on your machine and could speed up CPU computations.

2017-05-12 02:14:10.746764: W

tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow

library wasn't compiled to use AVX2 instructions, but these are

available on your machine and could speed up CPU computations.

2017-05-12 02:14:10.746777: W

tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow

library wasn't compiled to use FMA instructions, but these are

available on your machine and could speed up CPU computations.

2017-05-12 02:14:10.926330: I

tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] successful

NUMA node read from SysFS had negative value (-1), but there must be

at least one NUMA node, so returning NUMA node zero

2017-05-12 02:14:10.926614: I

tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0

with properties:

name: GeForce GTX 1060 6GB

major: 6 minor: 1 memoryClockRate (GHz) 1.7845

pciBusID 0000:01:00.0

Total memory: 5.93GiB

Free memory: 5.51GiB

2017-05-12 02:14:10.926626: I

tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0

2017-05-12 02:14:10.926629: I

tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0: Y

2017-05-12 02:14:10.926637: I

tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating

TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB,

pci bus id: 0000:01:00.0)

Device mapping:

/job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: GeForce GTX

1060 6GB, pci bus id: 0000:01:00.0

2017-05-12 02:14:10.949871: I

tensorflow/core/common_runtime/direct_session.cc:257] Device mapping:

/job:localhost/replica:0/task:0/gpu:0 -> device: 0, name: GeForce GTX

1060 6GB, pci bus id: 0000:01:00.0

我真的跑出来的东西去做。我唯一剩下的就是卸载anaconda并重新安装所有的东西,因为我真的花了整整一天的时间使它和keras以及所有东西一起工作(只是没有GPU),所以我真的不想这样做。

2017-05-12

Shooth

+0

你能解决这个问题。我面对完全相同的问题? –

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值