解决安装tensorflow等速度慢,超时

安装tensorflow-gpu速度慢

一般不建议采用pip install tensorflow-gpu1.5.0 --upgrade tensorflow-gpu方式,这种方式需要FQ而且下载速度超级慢。可以使用国内镜像,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脚本

  1. Python xx.py
  2. python -m xx 【xx代表文件名】

安装pytorch

Q:出现no module named ‘pip._internal’

搜索stackoverflow

Q:pytorch具体安装步骤:

1.上pytorch官网查看用pip那个命令安装【pip3 install torch torchvision

】,安装时最好切换为国内镜像源永久置换pip镜像源