解决AttributeError: module ‘torch‘ has no attribute ‘compile‘错误

ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

pytorch包的版本太低,需要大于2.0

升级

pip install --upgrade torch

升级报错 空间不够no space left on device

查看磁盘空间:

 du -h --max-depth=1

解决办法:
更改pip缓存目录,无效

pip config set global.cache-dir "data1/tmp"

更改环境变量 有效

export TMPDIR="临时替换的tmp文件夹"

torch
注意:
torch升级后可能会影响其他包
torchvison
torchaudio

物联沃分享整理
物联沃-IOTWORD物联网 » 解决AttributeError: module ‘torch‘ has no attribute ‘compile‘错误

发表评论