gpt4 book ai didi

python-3.x - 我在用gpu训练吗?

转载 作者:行者123 更新时间:2023-12-05 07:25:54 29 4
gpt4 key购买 nike

我正在训练一个以 keras 和 tensorflow 作为后端的神经模型。日志文件以以下消息开头:

nohup: ignoring input
2019-02-12 17:44:29.414526: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-02-12 17:44:30.191565: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:65:00.0
totalMemory: 7.93GiB freeMemory: 7.81GiB
2019-02-12 17:44:30.191601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0
2019-02-12 17:44:30.409790: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-12 17:44:30.409828: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0
2019-02-12 17:44:30.409834: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0: N
2019-02-12 17:44:30.410015: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7535 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:65:00.0, compute capability: 6.1)

这是否意味着训练是在 gpu 上进行的?

我会说是的,但是当我执行 nvtop 时,我看到所有的 gpu 内存都被使用了,而 gpu 计算能力被使用了 0%(见下面的黄色截图):

see screenshot

此外,当我在命令行中键入 htop 时,我看到一个 CPU 已被完全使用(参见下面的黑色屏幕截图)

see screenshot

怎么会用到gpu内存,用cpu容量计算而不是gpu容量计算?

最佳答案

我认为您已经编译(或安装了已编译的软件包)支持 CUDA 的 tensorflow,但不支持适用于您的 CPU 的所有指令(您的 CPU 支持 tensorflow 可以使用的 AVX2、AVX512F 和 FMA 指令)。

这意味着,tensorflow 可以正常工作(具有完整的 GPU 支持),但您不能满负荷使用处理器。

尝试用这个例子比较时间(GPU 与 CPU):https://stackoverflow.com/a/54661896/10418812

关于python-3.x - 我在用gpu训练吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54656022/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com