首次安装TensorFlow时,在尝试验证安装时会出错。 CUDA_ERROR_OUT_OF_MEMORY

时间:2018-02-15 10:08:39

标签: tensorflow keras jupyter-notebook nvidia

我和jupyter笔记本一起使用conda env keras。首先只安装了CPU,然后安装了GPU。尝试使用GPU TF制作另一个env,但仍然是同样的错误。 有人能指点我吗? 编辑:操作是标准的,安装了CUDA 9.0,在C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v9.0 \ bin中插入了文件cudnn64_7.dll。

import tensorflow as tf
hello = tf.constant('Hello')
sess = tf.Session()
print(sess.run(hello))

    2018-02-15 10:52:30.240960: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructi
ons that this TensorFlow binary was not compiled to use: AVX AVX2
2018-02-15 10:52:30.410969: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\core\common_runtime\gpu\gpu_device.cc:1105] Found device 0 with pro
perties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.392
pciBusID: 0000:01:00.0
totalMemory: 4.00GiB freeMemory: 3.86GiB
2018-02-15 10:52:30.410969: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\core\common_runtime\gpu\gpu_device.cc:1195] Creating TensorFlow dev
ice (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:0
1:00.0, compute capability: 6.1)
2018-02-15 10:52:32.394083: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 3.53G (
3790774272 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.482088: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 3.18G (
3411696640 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.527090: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 2.86G (
3070526976 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.551092: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 2.57G (
2763474176 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.574093: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 2.32G (
2487126784 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.595094: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 2.08G (
2238414080 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.613095: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 1.88G (
2014572800 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.629096: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 1.69G (
1813115648 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.645097: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 1.52G (
1631804160 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:32.658098: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\stream_executor\cuda\cuda_driver.cc:936] failed to allocate 1.37G (
1468623872 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-02-15 10:52:43.783734: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\3
6\tensorflow\core\common_runtime\gpu\gpu_device.cc:1195] Creating TensorFlow dev
ice (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:0
1:00.0, compute capability: 6.1)

2 个答案:

答案 0 :(得分:0)

您需要CuDNN V6.0,您可以查看要求https://www.tensorflow.org/install/install_windows
检查"要求在GPU支持下运行TensorFlow"

答案 1 :(得分:0)

问题是来自官方网站的安装说明错字。在GitHub上写了CuDNN 7。