开发者社区 > ModelScope模型即服务 > 语音 > 正文

modelscope1.6.1的环境,本地报错似乎提示使用正确 modelscope版本

代码是快速体验内容 报错内容: 'segmentation-clustering is not in the pipelines registry group segmentation-clustering. Please make sure the correct version of ModelScope library is used.'

展开
收起
Hydarlisk 2023-06-28 19:41:24 300 0
2 条回答
写回答
取消 提交回答
  • 北京阿里云ACE会长

    错误提示 'segmentation-clustering is not in the pipelines registry'。这个错误提示表明 ModelScope 没有找到名为 'segmentation-clustering' 的管道(pipeline)。

    可能出现这个错误的原因是因为您使用的 ModelScope 版本过低,不支持 'segmentation-clustering' 管道。请确保您使用的是 ModelScope 1.6.1 或更高版本,以获得对 'segmentation-clustering' 管道的支持。

    2023-07-10 18:21:13
    赞同 展开评论 打赏
  • 提供能在其他服务器ubuntu环境下跑通的脚本,亲测有效

    环境如下:

    Ubuntu 20.04 + Python3.8

    +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 530.30.02 Driver Version: 530.30.02 CUDA Version: 12.1 | |-----------------------------------------+----------------------+----------------------+

    ‘’‘ #!/bin/bash

    设置显存分片大小,防止OOM爆显存

    cat>/etc/profile.d/proxy.sh<<EOF export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32 EOF

    更新以及安装必须的软件

    apt update apt upgrade -y apt list --upgradable -a

    apt-get install libsndfile1 sox nano wget curl git zip -y

    apt autoclean -y apt autoremove -y

    登录时使能设置环境变量

    source /etc/profile.d/proxy.sh

    克隆官方基础库,魔法自备

    git clone https://github.com/modelscope/modelscope.git

    安装Audio所必须的包,亲测有效

    cd modelscope python -m pip install --upgrade pip pip install -r requirements/tests.txt pip install -r requirements/framework.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html pip install -r requirements/audio.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html pip install -r requirements/nlp.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html pip install . pip install tts-autolabel -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

    pip install typeguard==2.13.3 pydantic==1.10.10 numpy==1.21.6 kantts==0.0.1 -y pip uninstall funasr -y

    下载nltk包到根目录

    cd ~ wget https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/TTS/download_files/nltk_data.zip unzip nltk_data.zip

    接下来就可以按照描述中的步骤进行体验

    ‘’‘

    ‘’‘

    接下来用这个python脚本运行测试一下环境是否ok,如果没报错就应该是ok了

    from modelscope.tools import run_auto_label from modelscope.metainfo import Trainers from modelscope.trainers import build_trainer from modelscope.utils.audio.audio_utils import TtsTrainType import os from modelscope.models.audio.tts import SambertHifigan from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks import torch print(torch.version) print(torch.cuda.is_available())

    from modelscope.outputs import OutputKeys from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks

    text = '待合成文本' model_id = 'damo/speech_sambert-hifigan_tts_zh-cn_16k' sambert_hifigan_tts = pipeline(task=Tasks.text_to_speech, model=model_id) output = sambert_hifigan_tts(input=text, voice='zhitian_emo') wav = output[OutputKeys.OUTPUT_WAV] with open('output.wav', 'wb') as f: f.write(wav)

    ‘’‘

    最后需要特别注意的是,预训练model_revision = "v1.0.4"才可以

    kwargs = dict( model=pretrained_model_id, # 指定要finetune的模型 model_revision = "v1.0.4", # 就是这里,只有改成1.0.4才顺利通过 work_dir=pretrain_work_dir, # 指定临时工作目录 train_dataset=dataset_id, # 指定数据集id train_type=train_info # 指定要训练类型及参数 )

    2023-07-02 21:52:45
    赞同 1 展开评论 打赏

包括语音识别、语音合成、语音唤醒、声学设计及信号处理、声纹识别、音频事件检测等多个领域

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载