1.問題
Could not load dynamic library 'libcudart.so.11.0';
dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory;
LD_LIBRARY_PATH: /usr/local/cuda-10.0/lib64:
https://blog.csdn.net/qq_26018075/article/details/111546689,需要安裝:
conda install cudatoolkit=11.0
最終原因是,tensorflow是2.4版本,但已有的cuda版本為10.1,所以需要將tf降級。
但嘗試安裝卸載都出現問題,嘗試使用conda和pip來卸載都不行:
conda uninstall tensorflow #報錯: Collecting package metadata (repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/repodata.json> Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64'
#嘗試: pip uninstall tensorflow WARNING: Skipping tensorflow as it is not installed.
嘗試使用兩者直接安裝新版本也不行:
pip install tensorflow==2.0.0 #報錯: ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0
(from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.2.2, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2,
2.3.0, 2.3.1, 2.3.2, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0, 2.4.1, 2.5.0rc0, 2.5.0rc1,
2.5.0rc2, 2.5.0rc3, 2.5.0) ERROR: No matching distribution found for tensorflow==2.0.0
只包含更高版本的。
2.嘗試解決
https://blog.csdn.net/wsjzzcbq/article/details/101052960,根據這個添加清華源,
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes
不行,給出warining已經添加過了
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' already in 'channels' list, moving to the top
https://www.jianshu.com/p/777c7b7a3f3d,嘗試設置防火牆ssl
conda config --set ssl_verify false
仍舊不行。
查看python版本為3.8,選擇新建conda環境,廢棄此環境。但嘗試
仍然是這個報錯:
Collecting package metadata (current_repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/current_repodata.json> Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64'
無法連接到這個源,查看所有的源:
:~$ conda config --show-sources ssl_verify: False channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ - defaults show_channel_urls: True
嘗試使用瀏覽器訪問
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
本地windows可以訪問,linux嘗試通過命令來訪問:
curl https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
也可以訪問。
那么接下來嘗試依次刪掉上述源:
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ conda config --show-sources ==> .condarc <== ssl_verify: False channels: - defaults show_channel_urls: True
將所有清華源都刪除,終於出現了點不同的東西:
conda install tensorflow==2.0.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: |
輸出可能有版本沖突的問題:
所以更改安裝版本,根據cuda版本選擇1.14.0
首先查看tensorboardx2.1依賴的torch版本:
目前我的版本是:
torch 1.8.1 tensorboardx 2.1
tensorboard 2.4.1
tensorflow 2.4.1
https://www.jianshu.com/p/058fba2c2530,這篇博文中提到,
https://www.tensorflow.org/install/pip
當前環境的python版本是3.8,怪不得pip安裝的時候只有2.2版本及以上的,找不到2.2。
所以決定新建一個conda環境,py版本3.7的。
將清華源都刪除后,conda可以安裝包了。。。。