ubuntu利用conda創建虛擬環境,並安裝cuda,cudnn,tensorflow

1.創建虛擬環境:conda create -n your_env_name python=3.6,若不寫依賴項python的版本號,則默認安裝最新的python包
conda安裝倉庫
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
2.激活虛擬環境:conda activate your_env_name,只有激活虛擬環境,你才能使用虛擬環境
3.安裝cuda:conda install cudatoolkit=10.2.89
4.安裝cudnn:conda install cudnn=7.6.5
pip在線使用阿里源安裝
5.安裝tensorflow-gpu:pip install -i https://mirrors.aliyun.com/pypi/simple tensorflow-gpu==2.2.0rc3

pip永久使用阿里源:
cd $HOME
vi .pip/pip.conf 
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章