我已经准备好花费大量时间来研究堆栈溢出问题,并寻找答案,但是找不到任何东西
大家好,
我在Tensorflow上运行Keras。我已经安装了tensorflow v2.0.0和tensorflow-gpu v2.0.0。以及CUDAnn V10.1
我试图从Jupyter笔记本上运行某些CNN模型,但我发现Keras在CPU上运行该模型(检查任务管理器,CPU为100%)。
我尝试了这两个命令来检查我的代码是否在CPU或GPU上运行
import tensorflow as tf
print(device_lib.list_local_devices())
我得到了这个输出
2019-12-30 09:19:31.860668: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-12-30 09:19:31.875991: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2019-12-30 09:19:31.976610: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1050 major: 6 minor: 1 memoryClockRate(GHz): 1.493
pciBusID: 0000:01:00.0
2019-12-30 09:19:31.987518: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-12-30 09:19:31.993980: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-12-30 09:19:34.307004: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-12-30 09:19:34.312977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2019-12-30 09:19:34.316016: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2019-12-30 09:19:34.321996: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/device:GPU:0 with 3001 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1)
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 9698040825407999030
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3147261542
locality {
bus_id: 1
links {
}
}
incarnation: 15759540689914723584
physical_device_desc: "device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1"
]
我的系统具有Nvidea GTX Geforce 1050 GPU,但代码已完全在CPU上运行,并且我尝试通过卸载tensorflow仅使用tensorflow-GPU,但重新安装后结果仍然相同
请有人帮我!