配置TensorFlow2. GPU。解决Could not load dynamic library ‘cudart64_101.dll‘; dlerror: cudart64_101.dl

2020-10-21 16:29:19.467814: tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll

笔者之前一直使用1x版本的TensorFlow。

在GITHUB上下载了一些代码,要求在TensorFlow2.版本运行。pip install tensorflow==2.2以后,

运行tf.test.is_gpu_available()   返回False。 

2020-10-21 16:07:39.297448: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found
2020-10-21 16:07:39.299448: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

如何正确调用GPU?

解决:

  1. 去官网下载cudart64_101.dll文件,解压后有两个文件:
    在这里插入图片描述
  2. 放置cudart64_101.dll文件
    官网中已经写得很清楚了:

在这里插入图片描述 记得要重启!

再次运行程序,显示: 

2020-10-21 16:29:19.467814: tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll

成功!

转自:https://blog.csdn.net/weixin_43786241/article/details/109203995,作者给力

你可能感兴趣的:(Tensorflow,python)