已解决:Could not load dynamic library cudart64_110.dll not found

小豆苗 1年前 ⋅ 18355 阅读

今天在学习深度学习时,遇到了该问题,废话不多说,直接说解决办法。

两个方法:

方法1:去网址: https://www.dll-files.com/cudart64_110.dll.html      直接下载cudart64_110.dll文件,然后放到C:/Windows/System32/  如果不行,请放到C:/Windows/SysWOW64/ 下。不过该方法有没有其他后遗症,目前不得而知。

方法2:将tensorflow版本回退到2.3.0版本,此版本可以解决该问题。

回退命令:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==2.3.0

验证结论:

import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
print(tf.__version__)
a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)
print('GPU:', tf.test.is_gpu_available())

输出结果:

2.3.0
tf.Tensor(3.0, shape=(), dtype=float32)
GPU: True

 

 


全部评论: 0

    我有话说: