1、安装anaconda,使用conda新建虚拟环境
conda create -n pytorch python=3.9 numpy matplotlib pandas jupyter notebook(环境名为pytorch)
conda activate pytorch
conda deactivate
2、在新建的虚拟环境下面下载pytorch
conda install pytorch torchvision torchaudio -c pytorch
3、安装pycharm
新建项目,设置环境为上面新建的环境
使用代码检查环境配置是否成功
import torch
x=torch.rand(5,3)
print(x)
参考https://blog.csdn.net/zxhandroid/article/details/129074140
标签:新建,pytorch,虚拟环境,conda,anaconda,pycharm From: https://www.cnblogs.com/OctoberOrange/p/17792873.html