Anaconda 中的 Tensorflow-Gpu 和 Cuda 驱动程序问题

Problem with Tensorflow-Gpu and Cuda drivers in Anaconda

我在使用 Tensorflow-GPU 时遇到以下问题。在尝试为深度学习任务设置 gpus(在 Jupyter 中)时,出现以下错误:

InternalError                             Traceback (most recent call last)
<ipython-input-3-a08c39e19f9e> in <module>
     20     for gpu in gpus:
     21       tf.config.experimental.set_memory_growth(gpu, True)
---> 22     logical_gpus = tf.config.experimental.list_logical_devices('GPU')
     23     print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs")
     24   except RuntimeError as e:

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\framework\config.py in list_logical_devices(device_type)
    345     List of LogicalDevice objects
    346   """
--> 347   return context.context().list_logical_devices(device_type=device_type)
    348 
    349 

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\eager\context.py in list_logical_devices(self, device_type)
   1150   def list_logical_devices(self, device_type=None):
   1151     """Return logical devices."""
-> 1152     self.ensure_initialized()
   1153 
   1154     devices = []

~\Anaconda3\envs\tens-gpu\lib\site-packages\tensorflow_core\python\eager\context.py in ensure_initialized(self)
    490         if self._default_is_async == ASYNC:
    491           pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True)
--> 492         self._context_handle = pywrap_tensorflow.TFE_NewContext(opts)
    493       finally:
    494         pywrap_tensorflow.TFE_DeleteContextOptions(opts)

InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

我的 Cuda 版本是 Cuda 10.0.130,cudnn 是 7.6.4,而我有一个 Intel UHD Graphics 620 和一个 NVIDIA GeForce MX150 gpus。驱动程序已更新至 'optimised' 版本,但我真的不明白有什么问题。你能帮帮我吗,因为我已经尝试了我在网上找到的所有东西? 提前谢谢你

出现此错误的原因是您安装的 CUDA 工具包版本与 python 软件包 CUDA 工具包的版本不匹配,通常作为 Tensorflow GPU 的依赖项安装

运行 CUDA 应用程序要求系统至少具有一个支持 CUDA 的 GPU 和一个与 CUDA 工具包兼容的驱动程序。详情请参考下方

Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found

最简单的修复方法是安装最新的 NVIDIA GPU Computing Toolkit,因为如果没有,您将缺少 'cudart64_100.dll' 库。