服務器環(huán)境由被破壞了俄删,又重新裝下tensorflow
1)miniconda安裝后不能使用conda 命令,此時需要將執(zhí)行路徑導入環(huán)境變量:
? ?echo 'export PATH="/home/xwl/miniconda3/bin:$PATH"' >> ~/.bashrc
? ?source ~/.bashrc
2)創(chuàng)建一個新的虛擬環(huán)境奏路,方法是選擇 Python 解析器并創(chuàng)建一個?./tf目錄來存放它:
? ? ? conda create -n tf pip python=3.6
? ? ? 順便激活環(huán)境 source?activate tf ?或者 conda activate tf
? ? ? 失活命令 ? // conda deactivate 或者source?deactivate?
3)在虛擬環(huán)境中tensorflow安裝
? ? ? ?pip install --upgrade tensorflow-gpu -i https://pypi.mirrors.ustc.edu.cn/simple/
4)lsb_release -a
5)
Latest TensorFlow supports cuda 8-10. cudnn 6-7.
Each TensorFlow binary has to work with the version of cuda and cudnn it was built with. If they don't match, you have to change either the TensorFlow binary or the Nvidia softwares.
Official?tensorflow-gpu?binaries (the one downloaded by pip or conda) are built with cuda 9.0, cudnn 7 since TF 1.5, and cuda 10.0, cudnn 7 since TF 1.13. These are written in the?release notes. You have to use the matching version of cuda if using the official binaries.
If you don't like to change your Nvidia software, you can:
(1) Use a different version of TensorFlow
(2) Use non-official binaries built by others. e.g.:?https://github.com/mind/wheels/releases,?https://github.com/hadim/docker-tensorflow-builder#builds,
https://github.com/inoryy/tensorflow-optimized-wheels
(3) Build the binaries by yourself from source with your version of Nvidia software.
6)鏡像地址
阿里云?http://mirrors.aliyun.com/pypi/simple/
中國科技大學?https://pypi.mirrors.ustc.edu.cn/simple/?
豆瓣(douban)?http://pypi.douban.com/simple/?
清華大學?https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術(shù)大學?http://pypi.mirrors.ustc.edu.cn/simple/
使用:pip install tensorflow-gpu==1.12.0 ?-i http://pypi.douban.com/simple
7)
https://tensorflow.google.cn/install/source
8)?pip install opencv-python