环境:
ubuntu18
anaconda
创建一个新的环境
conda create -n env_name python=version
激活并进入环境中
conda activate tensorflow
pip更改清华源(https://mirrors.tuna.tsinghua.edu.cn/help/pypi/)
conda更换清华源,这个似乎更新的慢一些?(https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)
conda list 看有没有cuda,cudnn,没有的话下面再装(conda install cudatoolkit conda install cudnn)最好自己指定下版本号 (发文时是10.1 和7.6)
安装pytorch
pip3 install torch torchvision
然后将pytorch 添加到jupyter notebook中(要在对应的环境下操作)
install ipykernel
python -m ipykernel install --user --name pytorch --display-name "Python (pytorch)"
查看列表jupyter kernelspec list
删除指定kernel:jupyter kernelspec remove icsharpkernel
某出品的教程
https://tangshusen.me/Dive-into-DL-PyTorch/#/
写个小程序测试一下