暂无分类
暂无标签
发布于2020-07-22 22:54 阅读(161) 评论(0) 点赞(1) 收藏(5)
0
1
2
3
4
5
6
design by ht
3行缩进表要键入的代码
下载:
https://www.anaconda.com/distribution/#download-section
双击安装
选择 All users
勾选 Add Anaconda3 to the system PATH environment variable
测试是否anaconda是否安装成功
win+ R
cmd
conda
复制下面代码输入
######中科大 #设置搜素时显示通道地址
conda config --add channels https:/mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --akld channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show channel_urls yes
######清华
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
######pip 清华
pip config set global.index-url https://mirrors.alyun.com/pypi/simple
阿里云 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
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple
conda create -n pytorch_1.5_gpu python=3.6
y
若中科大镜像原安装失败,则换清华镜像源重置
先移除中科大
conda config --remove-key channels
conda config --show
在channels 中有镜像源
复制清华镜像源
进入虚拟环境
conda activate pytorch_1.5_gpu
conda create -n pytorch_1.4_cpu python=3.7
y
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-g22CpfmL-1595321586142)(C:\Users\ht\AppData\Roaming\Typora\typora-user-images\image-20200721114725353.png)]
进入虚拟环境2
conda activate pytorch_1.4_cpu
退出环境
conda deactivate
下载:
https://www.jetbrains.com/pycharm/
激活:
https://shimo.im/docs/GJTqgHqh6kGYkKKY/read
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vfZMv4Oe-1595321586145)(C:\Users\ht\AppData\Roaming\Typora\typora-user-images\image-20200721120240780.png)]
下载:
https://developer.nvidia.com/cuda-gpus#collapseOne
安装步骤:
1.检查pytorch版本所支持的cuda版本,下载对应版本的CUDA
2.下载CUDA安装包,下载对应CUDA版本的cudnn安装包
3.安装并验证安装成功
查看cuda 版本
cd C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
nvcc -V
结果显示
Copyright © 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89
下载:https://developer.nvidia.com/cudnn
cd C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\extras\demo_suite
bandwidthTest.exe
结果显示 Result = PASS 即可
deviceQuery.exe
结果显示 Result = PASS 即可
命名解释:
cu92/torch-1.2.0%2Bcu92-cp37-cp37m-win_amd64.whl
cuda版本或cup pytorch版本号 python版本号 操作系统
虚拟环境1 python=3.6 pytorch =1.5.0 (GPU)
https://download.pytorch.org/whl/torch_stable.html
Ctrl +F 搜索 cu102/torch-1.5.0-cp36 下载
cu102/torchvision-0.6.0-cp36 下载
两个文件下载在文件夹 C:\Users\ht\Desktop\pytorch
进入pycharm Terminal
C:
cd C:\Users\ht\Desktop\pytorch
dir
pip install torch-1.5.0-cp36-cp36m-win_amd64.whl
结果显示:
Successfully installed future-0.18.2 numpy-1.19.0 torch-1.5.0
pip install torchvision-0.6.0-cp36-cp36m-win_amd64.whl
结果显示:
Successfully installed pillow-7.2.0 torchvision-0.6.0
如果下载速度过慢,添加镜像源
阿里云 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
中国科学技术大学 [http://pypi.mirrors.ustc.edu.cn/simple
pip config set global.index-url https://mirrors.alyun.com/pypi/simple
虚拟环境2 python=3.7 pytorch=1.4.0 (CPU)
https://download.pytorch.org/whl/torch_stable.html
Ctrl +F 搜索 cpu/torch-1.4.0%2Bcpu-cp37 下载
cpu/torchvision-0.5.0%2Bcpu-cp37 下载
l两个文件下载在文件夹 C:\Users\ht\Desktop\pytorch
进入pycharm Terminal
deactivate
查看所有虚拟环境
conda info --envs
conda activate pytorch_1.5_cpu
pip install “torch-1.4.0+cpu-cp37-cp37m-win_amd64.whl”
结果显示:
Successfully installed torch-1.4.0+cpu
pip install “torchvision-0.5.0+cpu-cp37-cp37m-win_amd64.whl”
结果显示
Successfully installed numpy-1.19.0 pillow-7.2.0 six-1.15.0 torchvision-0.5.0+cpu
结果显示:
Successfully installed torch-1.4.0+cpu
pip install “torchvision-0.5.0+cpu-cp37-cp37m-win_amd64.whl”
结果显示
Successfully installed numpy-1.19.0 pillow-7.2.0 six-1.15.0 torchvision-0.5.0+cpu
0
1
2
3
4
作者:天青色等烟雨
链接: https://www.pythonheidong.com/blog/article/455776/db9defd46c6251155594/
来源: python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
Copyright © 2018-2021 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系z452as@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!