tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘cudart
相关链接相关链接
·
产生原因:
tensorflow和cuda版本不对应
通过下面的网址可以查看tensorflow和cuda的版本映射关系
https://tensorflow.google.cn/install/source#gpu
解决方法:
查看本机tensorflow的版本
打开命令行,输入:
pip show tensorflow
有些版本需要tensorflow-gpu,如上图最后一行,通过下面的指令查看
pip show tensorflow-gpu
查看本机cuda版本
打开
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
查看这个文件夹下的版本
下载tensorflow
pip install tensorflow==2.0.0
下载cuda
在浏览器下查找特定版本的cuda,然后下载
测试程序
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())
零零碎碎
安装tensorflow:
pip install tensorflow-gpu==2.6.0
更多推荐
所有评论(0)