尝试验证安装时首次安装 TensorFlow 时出错。 CUDA_ERROR_OUT_OF_MEMORY
First install of TensorFlow gives error when tried validating the installation. CUDA_ERROR_OUT_OF_MEMORY
我是 运行 使用 jupyter notebook 的 conda env keras。首先只安装 CPU,然后安装 GPU。尝试仅使用 GPU TF 创建另一个环境,但仍然出现相同的错误。
有人可以给我指示吗?
编辑:操作是标准的,安装了 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
你需要CuDNN V6.0,可以查看需求https://www.tensorflow.org/install/install_windows
在 "Requirements to run TensorFlow with GPU support"
下查看
问题是官方网站的安装说明中的拼写错误。在 GitHub 处写了 CuDNN 7.
我是 运行 使用 jupyter notebook 的 conda env keras。首先只安装 CPU,然后安装 GPU。尝试仅使用 GPU TF 创建另一个环境,但仍然出现相同的错误。 有人可以给我指示吗? 编辑:操作是标准的,安装了 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
你需要CuDNN V6.0,可以查看需求https://www.tensorflow.org/install/install_windows
在 "Requirements to run TensorFlow with GPU support"
问题是官方网站的安装说明中的拼写错误。在 GitHub 处写了 CuDNN 7.