前提:安装了Anaconda并检查输入的相应指令结果是否和下面一样,如果不一样
解决方法:
P1. PyTorch环境的配置及安装(Configuration and Installation of PyTorch)【PyTorch教程】_哔哩哔哩_bilibili
P2. Python编辑器的选择、安装及配置(PyCharm、Jupyter安装)【PyTorch教程】_哔哩哔哩_bilibili
上述问题解决完后,如果看完了P2视频,在pycharm中导入torch时遇到了torch.cuda.is_available()返回false的问题,解决方法如下:
pycharm版本
第一步,创建newproject,如下界面,点击红标所指
第二步,操作如下,点击ok即可
jupyter notebook
解决:AttributeError: type object 'IOLoop' has no attribute 'initialized'
输入3后最后一行结果显示“AttributeError: type object 'IOLoop' has no attribute 'initialized'”
错误原因:tornado版本过高,不支持jupyter notebook
解决方法:第一步:输入pip uninstall tornado
第二步:conda install tornado=4.5