一、问题描述
希望在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
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
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.spk2idstart = 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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
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版本
登录 后才可以发表评论