- 一、Pytorch安装
- 1.安装anaconda
- 2.更新软件源
- 3.创建并激活虚拟环境
- 4.安装pytorch
- 二、conda命令
- 三、jupyter notebook设置
- 1.UI设置
- 2.虚拟环境中使用jupyter notebook
- 3.增加代码补全
- conda config
- 打开 C:Users用户名.condarc 文件, 修改为:
channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ ssl_verify: false show_channel_urls: true3.创建并激活虚拟环境
conda create -n env_name python=3.7
activate env_name
官网地址:pytorch官网
根据自己硬件环境生成相应的安装命令, 我的是
conda install pytorch torchvision torchaudio cpuonly
注意要 去掉末尾的-c pytorch,这个默认安装渠道为官方渠道,可能会很慢
conda info 查看软件源 conda info -e 查看所有虚拟环境三、jupyter notebook设置 1.UI设置
两种风格
jt -t oceans16 -f fira -fs 14 -cellw 96% -ofs 14 -dfs 14 -T jt --lineh 140 -f consolamono -cellw 96% -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 16 -T -N2.虚拟环境中使用jupyter notebook
conda install nb_conda
3.增加代码补全conda install jupyter_contrib_nbextensions jupyter contrib nbextension install --user --skip-running-check



