使用tensorflow 2.4.1
当我运行我的程序时,我得到这个错误,不能使用我的gpu
。
我使用的是CUDA 11.0
、cudnn 8.0
2021-02-07 03:36:18.132005: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
WARNING:tensorflow:From D:/PycharmProjects/pythonProject/models/kpş,i.py:5: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2021-02-07 03:36:19.735127: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-02-07 03:36:19.739052: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library nvcuda.dll
2021-02-07 03:36:20.715634: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1650 computeCapability: 7.5
coreClock: 1.56GHz coreCount: 16 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 119.24GiB/s
2021-02-07 03:36:20.716281: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
2021-02-07 03:36:20.723519: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll
2021-02-07 03:36:20.724040: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll
2021-02-07 03:36:20.729436: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cufft64_10.dll
2021-02-07 03:36:20.731800: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library curand64_10.dll
2021-02-07 03:36:20.741580: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusolver64_10.dll
2021-02-07 03:36:20.745576: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cusparse64_11.dll
2021-02-07 03:36:20.746657: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2021-02-07 03:36:20.746971: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1757] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-02-07 03:36:20.836861: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-02-07 03:36:20.837144: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0
2021-02-07 03:36:20.837314: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N
2021-02-07 03:36:20.837493: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
7条答案
按热度按时间gc0ot86w1#
我想我可以帮助您提供一个
cudnn64_8.dll
文件(这是下载链接:https://www.dll-files.com/cudnn64_8.dll.html),当你得到这个文件的时候,你可以直接放在你的bin
目录下,比如通常在windows平台下,你可以放在C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin
下。ecr0jaav2#
丢失的dll文件位于cuDNN文件夹中。我能够通过将
cudnn64_8.dll
文件复制到CUDA文件夹中来解决这个问题,即C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
。cuDNN被列为TensorFlow工作的一个要求,你可以下载它here。不过你需要先注册一个开发者帐户。
eqzww0vc3#
观看video来解决这个问题,
由于CUDA文件夹中缺少Microsoft Visual Studio C++可复制文件,因此会出现找不到此文件错误。
附加;
对于
PyTorch in conda environment
,没有额外的CUDA和Cudnn安装,因为在键入conda install pytorch
之后,conda会将CUDA和Cudnn安装到该conda环境中。tcomlyy64#
我在按照CuDNN的所有安装说明安装之后也遇到了这个问题。问题的根本原因非常简单。在安装说明中,它告诉你将
<root>\NVIDIA\CUDNN\v8.x
添加到你的PATH
。至少对于Tensorflow来说,这是错误的。你需要将<root>\NVIDIA\CUDNN\v8.x\bin
添加到你的PATH
。这应该可以解决这个问题。它对我来说是这样的。我看到了一些关于将
cudnn64_8.dll
文件移动到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
的答案。之所以这样做是因为CUDA会在安装PATH
时自动将bin目录添加到您的PATH
中。因此,将cudnn64_8.dll
移动到那里实际上会将其添加到您的PATH
中。我宁愿把东西放在合适的位置,所以我更喜欢这样。
qvsjd97n5#
我也遇到了这个错误,我发现cudnn需要一个不同的安装。这里有一个安装指南和需要的包https://developer.nvidia.com/cudnn。
*edit -〉在上面的链接中,您可以下载tensorflow需要的cuddn版本,然后将它们放在所需的文件夹中,这将解决您的问题。
6tr1vspr6#
这将解决您的问题:
ukdjmx9f7#
我遇到了同样的错误。this link中提出的解决方案对我有效。他们提出安装cuDNN并解释如何安装here
对我个人来说,我们最重要的解释是ZLIB(或者更具体地说是Zlibwapi),我通过Anaconda安装了它。