记录踩过的坑-PyTorch

安装报错

按PyTorch官网给出的命令

复制代码
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

报错

复制代码
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

原因:当前python版本过低(我是3.6)

解决方法:用Anaconda重新建一个Python高版本环境(比如3.10)

RuntimeError: Distributed package doesn't have NCCL built in

我的是Windows系统,不支持nccl

在运行的py文件最开始加代码

复制代码
import os
os.environ["PL_TORCH_DISTRIBUTED_BACKEND"] = "gloo"

修改类似地方,把nccl改成gloo

复制代码
torch.distributed.init_process_group("nccl")
相关推荐
aqi008 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
用户5191495848459 小时前
libcurl Headers API 释放后重利用漏洞:跨请求复用头句柄导致堆内存安全风险
人工智能·aigc
踩蚂蚁9 小时前
自定义语音唤醒词:从训练到部署的完整链路实践
人工智能
用户5191495848459 小时前
CVE-2025-1094 PostgreSQL SQL注入与WebSocket劫持远程代码执行利用工具
人工智能·aigc
金銀銅鐵10 小时前
用 Python 实现 Take-Away 游戏
python·游戏
IT_陈寒10 小时前
SpringBoot自动配置这个坑,我踩进去又爬出来了
前端·人工智能·后端
copyer_xyf10 小时前
Agent 流程编排
后端·python·agent
copyer_xyf11 小时前
Agent RAG
后端·python·agent
copyer_xyf11 小时前
【RAG】向量数据库:milvus
后端·python·agent