78 Star 599 Fork 1.2K

Ascend/pytorch

ERROR: No matching distribution found for torch==2.1.0+cpu

DONE
缺陷
创建于  
2024-12-07 10:14

一、问题描述
希望在x86服务器上安装torch依赖包,执行tts模型。当前安装pip install torch_npu-2.1.0.post8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl时出错,提示

ERROR: Could not find a version that satisfies the requirement torch==2.1.0+cpu (from torch-npu) (from versions: 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0, 2.5.1)
ERROR: No matching distribution found for torch==2.1.0+cpu

二、环境 (172)

Architecture: x86_64 (lscpu)
#211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 (uname -v)
torchvision 0.16.0
torch 2.1.0

三、复现方法

import torch
print(torch.version)
2.1.0
import torch_npu
print(torch_npu.version)
2.1.0.post6

torch-2.1.0-cp311-cp311-manylinux1_x86_64.whl
torch_npu-2.1.0.post8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

评论 (3)

zhongyunde 创建了缺陷 6个月前
  • 确认了下 不带 gpu 的平台上,touch不必安装 +cpu的也可以运行, 比如 如下的组合能支持 纯cpu平台上执行需要 torch 的tts应用
pip install torchvision==0.16.0 numpy==1.23.5  torchaudio==2.1.0 

(/py311-tts) root@998ee80b761b:/home/zhongyunde/source/MeloTTS# pip list | grep torch
torch                    2.1.0
torch-mlir               20241002.240
torchaudio               2.1.0
torchvision              0.16.0
  • 测试用例:(/py311-tts) root@998ee80b761b:/home/zhongyunde/source/MeloTTS# cat test_cpu.py

import torch
#import torch_npu
from melo.api import TTS
import time
#from torch_npu.contrib import transfer_to_npu
#torch.npu.set_compile_mode(jit_compile=False)

speed = 1.0
device = 'cpu'
model = TTS(language='ZH', device=device,config_path= "./model/melotts/config.json", ckpt_path="./model/melotts/checkpoint.pth")
speaker_ids = model.hps.data.spk2id

start = time.time()
text = """
Welcome to Willow. This is an example 3 second file."""
for i in range(2):
start = time.time()
model.tts_to_file(text, speaker_ids['ZH'], output_path = "../test_1014_3sec.wav", speed=speed)
end = time.time()
print(end-start)

zhongyunde 任务状态TODO 修改为DONE 6个月前
zhongyunde 任务状态DONE 修改为WIP 6个月前

https://gitee.com/ascend/pytorch 上描述了不同cpu平台的安装方法,因此这可能是针对不同cpu的版本选择

aarch64:pip3 install torch==2.1.0
x86:pip3 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu

torch_npu配套torch的cpu版本使用,torch的cpu版本在arm和x86上安装方式不一样,如上,x86上安装cpu版本需要指定index-url,如果直接安装默认是cuda版本

huangyunlong 任务状态WIP 修改为DONE 6个月前

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
优先级
预计工期 (小时)
开始日期   -   截止日期
-
置顶选项
参与者(2)
zhongyunde-zhongyunde huangyunlong-huangyunlong2022
Python
1
https://gitee.com/ascend/pytorch.git
git@gitee.com:ascend/pytorch.git
ascend
pytorch
pytorch

搜索帮助