ubuntu16.04+pytorch–CPU版安装
1、安装anaconda
anaconda下载地址
python对应anaconda版本
执行如下步骤安装
bash Anaconda3-2020.02-Linux-x86_64.sh
//安装完成执行如下,设置环境变量
gedit ~/.bashrc
//添加环境变量
export PATH=/home/rikirobot/anaconda3/bin:$PATH
2、安装pytorch
复制 Run this Command:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
运行报错
rikirobot@robot:~$ conda install pytorch torchvision torchaudio cpuonly -c pytorch
Fetching package metadata ...
........
Solving package specifications:
PackageNotFoundError: Dependencies missing in current linux-64 channels:
- torchaudio -> pytorch 1.10.2 -> cudatoolkit >=11.1,<11.2
- torchaudio -> pytorch 1.10.2 -> libuv >=1.40.0,<2.0a0
- torchaudio -> pytorch 1.10.2 -> mkl >=2018
- torchaudio -> pytorch 1.10.2 -> typing_extensions
- torchaudio -> pytorch 1.10.2 -> dataclasses
- torchaudio -> python_abi 3.9.* *_cp39
- torchaudio -> librosa >=0.4.3
- torchaudio -> sox
Close matches found; did you mean one of these?
python_abi: python, ipython
(and similarly for the other packages)
找不到对应的包
解决:
1、使用conda,qinghua源去搜索包时出现了 packages missing 的错误,但并不代表这个包或者这个版本的包找不到,我们可以尝试用以下办法: anaconda search -t conda pytorch , 也可在后面加上包的版本号,去搜索:
2、anaconda show prigoyal/pytorch查看安装方法
3、执行
conda install --channel https://conda.anaconda.org/prigoyal pytorch
参考链接:
https://www.jianshu.com/p/d08798218e1e
https://blog.csdn.net/qq_45779334/article/details/121099052
https://blog.csdn.net/weixin_45885232/article/details/107507921