pytorch在linux+ CPU安装过程及pip memoryError问题解决

在Linux上使用pip安装PyTorch时遇到MemoryError,问题根源是缓存导致。通过添加`--no-cache-dir`参数尝试解决,但未成功。最终通过升级pip到最新版解决了安装问题,成功安装PyTorch 1.10.1+cpu,torchvision 0.11.2+cpu和torchaudio 0.10.1+cpu。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装pytorch 官方提供了在各种平台及cpu下安装的命令:

Start Locally | PyTorchd

在linux下cpu安装命令为:

pip3 install torch==1.10.1+cpu torchvision==0.11.2+cpu torchaudio==0.10.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

需要先安装好python && pip 一般都带的

但是安装过程出现MemoryError的报错提示

# pip3 install torch==1.10.1+cpu torchvision==0.11.2+cpu torchaudio==0.10.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting torch==1.10.1+cpu
  Downloading https://download.pytorch.org/whl/cpu/torch-1.10.1%2Bcpu-cp36-cp36m-linux_x86_64.whl (199.3MB)
    99% |████████████████████████████████| 199.3MB 12.0MB/s eta 0:00:01Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-pack
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值