创建conda虚拟环境conda create -n name python=3.9
进入环境conda activate name
由于conda下载经常出错,采用pip安装。在这个网页torch安装地址下载whl文件
我下的这个
https://download.pytorch.org/whl/cu113/torch-1.11.0%2Bcu113-cp39-cp39-linux_x86_64.whl
然后pip intall torch-1.11.0+cu113-cp39-cp39-linux_x86_64.whl
同理,安装torchvision,https://download.pytorch.org/whl/cu113/torchvision-0.12.0%2Bcu113-cp39-cp39-linux_x86_64.whl
安装依赖库pip install numpy
成功