From 6d9e92f710760ab21228774d037153cf9fe264d6 Mon Sep 17 00:00:00 2001 From: xsl Date: Sat, 18 Jul 2026 16:30:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20torch=20=E5=8D=87=E7=BA=A7=E4=B8=BA=20?= =?UTF-8?q?2.11.0+cu128=20=E6=94=AF=E6=8C=81=20RTX=205090=20(sm=5F120)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原 torch 2.2.2+cu121 只编到 sm_90,在 RTX 5090 上 GPU 算子报 'no kernel image',接口2 因 SegFormer/BiSeNet 跑不动 GPU 而失败。 venv 实际已升级到 torch 2.11.0+cu128 / torchvision 0.26.0+cu128, 此处同步 requirements.txt 让文档与实际环境一致。 numpy 保持 1.26.4(<2,mediapipe/scikit-image 依赖),cu128 兼容。 --- requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index bd27046..f5ca68f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,13 +10,13 @@ Pillow==11.0.0 # 标注图生成(PNG 透明图层) numpy==1.26.4 # 必须 <2,否则 mediapipe 0.10.x import 崩溃 # 方案 B:头发分割(BiSeNet face-parsing) -# 国内安装可走 Tsinghua 镜像(PyPI 的 linux wheel 即 CUDA 12.1 构建): -# ./venv/bin/pip install torch==2.2.2 torchvision==0.17.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/ -# ⚠️ 本 worker 是 RTX 5090(sm_120/Blackwell),torch 2.2.2(cu121) 只编到 sm_90, -# GPU 上跑算子会报 "no kernel image",代码已自动回退 CPU(方案B 仍可用)。 -# 要真正用 5090 GPU,请换 torch cu128(≥2.7)+ 对应 torchvision,代码无需改。 -torch==2.2.2 # 当前在 5090 上仅 CPU 可用;GPU 需 cu128(≥2.7) -torchvision==0.17.2 +# ⚠️ RTX 5090(sm_120/Blackwell)必须用 cu128 构建——cu121(如 torch 2.2.2)只编到 +# sm_90,GPU 跑算子会报 "no kernel image"。cu128 含 sm_120,BiSeNet/SegFormer 走 GPU。 +# 安装(走 PyTorch 官方 cu128 index): +# ./venv/bin/pip install --index-url https://download.pytorch.org/whl/cu128 torch==2.11.0 torchvision==0.26.0 +# numpy 必须保持 <2(mediapipe 0.10.x / scikit-image 0.24.x 依赖),cu128 torch 兼容 numpy 1.26.4。 +torch==2.11.0 # +cu128,支持 RTX 5090 sm_120;GPU 推理 +torchvision==0.26.0 # 接口2:C端生发(发际线预览) # MediaPipe Tasks(FaceLandmarker) 用已装的 mediapipe;新增 SegFormer 人脸分割: