ubuntu18安装pytorch1.3

可紊 提交于 2019-12-04 00:45:19

环境:
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/#/

写个小程序测试一下

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!