python 查tensorflow版本_python – 如何检查keras是否使用gpu版本的tensorflow?

这篇博客讨论了如何确定Keras是否利用GPU版本的TensorFlow进行运算。通过运行Keras脚本,作者发现系统检测到了GPU设备(GeForce GTX 850M),但遇到了内存不足的问题。输出日志表明TensorFlow可以使用CPU的SSE4.1、SSE4.2、AVX和FMA指令来加速计算,但并未针对这些特性编译。
部署运行你感兴趣的模型镜像

当我运行keras脚本时,我得到以下输出:

Using TensorFlow backend.

2017-06-14 17:40:44.621761: 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-06-14 17:40:44.621783: 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-06-14 17:40:44.621788: 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-06-14 17:40:44.621791: 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-06-14 17:40:44.621795: 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-06-14 17:40:44.721911: 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-06-14 17:40:44.722288: I

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

with properties:

name: GeForce GTX 850M

major: 5 minor: 0 memoryClockRate (GHz) 0.9015

pciBusID 0000:0a:00.0

Total memory: 3.95GiB

Free memory: 3.69GiB

2017-06-14 17:40:44.722302: I

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

2017-06-14 17:40:44.722307: I

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

2017-06-14 17:40:44.722312: I

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

TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 850M,

pci bus id: 0000:0a:00.0)

这是什么意思?我使用GPU或CPU版本的张量流?

在安装keras之前,我正在使用GPU版本的tensorflow。

另外sudo pip3列表显示tensorflow-gpu(1.1.0),没有像tensorflow-cpu。

运行[此stackoverflow问题]中提到的命令,提供以下内容:

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-06-14 17:53:31.424793: 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-06-14 17:53:31.424803: 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-06-14 17:53:31.424812: 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-06-14 17:53:31.424820: 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-06-14 17:53:31.540959: 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-06-14 17:53:31.541359: I

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

with properties:

name: GeForce GTX 850M

major: 5 minor: 0 memoryClockRate (GHz) 0.9015

pciBusID 0000:0a:00.0

Total memory: 3.95GiB

Free memory: 128.12MiB

2017-06-14 17:53:31.541407: I

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

2017-06-14 17:53:31.541420: I

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

2017-06-14 17:53:31.541441: I

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

TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 850M,

pci bus id: 0000:0a:00.0)

2017-06-14 17:53:31.547902: E

tensorflow/stream_executor/cuda/cuda_driver.cc:893] failed to

allocate 128.12M (134348800 bytes) from device:

CUDA_ERROR_OUT_OF_MEMORY

Device mapping:

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

GTX 850M, pci bus id: 0000:0a:00.0

2017-06-14 17:53:31.549482: I

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

mapping:

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

GTX 850M, pci bus id: 0000:0a:00.0

您可能感兴趣的与本文相关的镜像

TensorFlow-v2.15

TensorFlow-v2.15

TensorFlow

TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值