1 问题
环境
python 3.8
tensorflow 2.3
CUDA 10.1
问题:
在使用import tensorflow as tf 时出现错误
Could not load dynamic library ‘libcudart.so.10.1’; dlerror: libcudart.so.10.1: cannot open shared object file:No such file or directory;LD_LIBRARY_PATH:/usr/local/cuda/lib64::/usr/local/cuda/extras/CUPTI/lib64
2 解决办法
原因是CUDA10.1不支持Tensorflow2.2+。那就使用Tensorflow2.0
(1)创建conda环境
conda create -n tf1 python=3.6
conda activate tf1
(2)安装tensorflow2.0
pip install tensorflow-gpu==2.0