安裝tensorflow-gpu速度慢
一般不建議采用pip install tensorflow-gpu1.5.0 --upgrade tensorflow-gpu方式,這種方式需要翻牆而且下載速度超級慢。可以使用國內鏡像,pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu1.5.0
pip --default-timeout=1000000 install -U -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu 這樣還可以防止超時
pip --default-timeout=1000000 install -U -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu==2.0.0 這樣還可以防止超時,還是指定版本
卸載 pip uninstall tensorflow-gpu
鏡像網址
清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里雲:http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
運行Python腳本
- Python xx.py
- python -m xx 【xx代表文件名】
安裝pytorch
Q:出現no module named ‘pip._internal’
搜索stackoverflow
Q:pytorch具體安裝步驟:
1.上pytorch官網查看用pip那個命令安裝【pip3 install torch torchvision
】,安裝時最好切換為國內鏡像源永久置換pip鏡像源