首页 > 其他分享 >【环境部署】TransformersTTS模型 -- 将文字转化为语音

【环境部署】TransformersTTS模型 -- 将文字转化为语音

时间:2023-06-23 18:55:29浏览次数:41  
标签:语音 23 -- py TransformersTTS user TransformerTTS tensorflow TTS36

论文背景

A Text-to-Speech Transformer in TensorFlow 2

模型仓库+文档

https://github.com/as-ideas/TransformerTTS

安装

1. python 3.6环境

conda create -n TTS36 python==3.6
conda activate TTS36  

2. github仓库

git clone thub.com/as-ideas/TransformerTTS.git

3. pip软件包

cd TransformerTTS
pip install -r requirements.txt

此时运行得到错误信息

(TTS36) user@ubuntu:~/model/model3/TransformerTTS$ python predict_tts.py -t "Please, say something."
2023-06-22 23:18:30.259622: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-06-22 23:18:30.259658: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "predict_tts.py", line 7, in <module>
    from data.audio import Audio
  File "/home/user/model/model3/TransformerTTS/data/audio.py", line 6, in <module>
    import librosa.display
  File "/home/user/anaconda3/envs/TTS36/lib/python3.6/site-packages/librosa/display.py", line 23, in <module>
    from matplotlib.cm import get_cmap
  File "/home/user/anaconda3/envs/TTS36/lib/python3.6/site-packages/matplotlib/__init__.py", line 139, in <module>
    from . import cbook, rcsetup
  File "/home/user/anaconda3/envs/TTS36/lib/python3.6/site-packages/matplotlib/rcsetup.py", line 27, in <module>
    from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  File "/home/user/anaconda3/envs/TTS36/lib/python3.6/site-packages/matplotlib/fontconfig_pattern.py", line 18, in <module>
    from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
  File "/home/user/anaconda3/envs/TTS36/lib/python3.6/site-packages/pyparsing/__init__.py", line 130, in <module>
    __version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'

更改包版本

pip install pyparsing==2.4.7

记录一下此时的版本

(TTS36) user@ubuntu:~/model/model3/TransformerTTS$ pip list
Package                 Version
----------------------- ---------
absl-py                 0.15.0
astunparse              1.6.3
attrs                   22.2.0
audioread               3.0.0
cached-property         1.5.2
cachetools              4.2.4
certifi                 2023.5.7
cffi                    1.15.1
charset-normalizer      2.0.12
clang                   5.0
clldutils               3.12.0
colorlog                6.7.0
csvw                    2.0.0
cycler                  0.11.0
Cython                  0.29.35
dataclasses             0.8
decorator               5.1.1
dill                    0.3.4
flatbuffers             1.12
gast                    0.4.0
google-auth             1.35.0
google-auth-oauthlib    0.4.6
google-pasta            0.2.0
grpcio                  1.48.2
h5py                    3.1.0
idna                    3.4
importlib-metadata      4.8.3
isodate                 0.6.1
joblib                  1.1.1
keras                   2.6.0
Keras-Preprocessing     1.1.2
kiwisolver              1.3.1
librosa                 0.7.1
llvmlite                0.31.0
Markdown                3.3.7
matplotlib              3.2.2
multiprocess            0.70.12.2
numba                   0.48.0
numpy                   1.19.5
oauthlib                3.2.2
opt-einsum              3.3.0
p-tqdm                  1.3.3
pathos                  0.2.8
phonemizer              2.2.2
pip                     21.3.1
pox                     0.3.0
ppft                    1.6.6.4
protobuf                3.19.6
pyasn1                  0.5.0
pyasn1-modules          0.3.0
pycparser               2.21
pyparsing               2.4.7
python-dateutil         2.8.2
pyworld                 0.3.3
regex                   2023.6.3
requests                2.27.1
requests-oauthlib       1.3.1
resampy                 0.3.1
rfc3986                 1.5.0
rsa                     4.9
ruamel.yaml             0.17.32
ruamel.yaml.clib        0.2.7
scikit-learn            0.24.2
scipy                   1.5.4
segments                2.2.1
setuptools              59.6.0
six                     1.15.0
soundfile               0.12.1
tabulate                0.8.10
tensorboard             2.6.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit  1.8.1
tensorflow              2.6.2
tensorflow-estimator    2.6.0
termcolor               1.1.0
threadpoolctl           3.1.0
tqdm                    4.40.1
typing-extensions       3.7.4.3
uritemplate             4.1.1
urllib3                 1.26.16
webrtcvad               2.0.10
Werkzeug                2.0.3
wheel                   0.37.1
wrapt                   1.12.1
zipp                    3.6.0

4. 预处理模型

下载地址

https://public-asai-dl-models.s3.eu-central-1.amazonaws.com/TransformerTTS/api_weights/bdf06b9_ljspeech/bdf06b9_ljspeech_step_90000.zip

解压

运行

(TTS36) user@ubuntu:~/model/model3/TransformerTTS$ python predict_tts.py -t "Please, say something." -p /home/user/model/model3/TransformerTTS/model/mobel/bdf06b9_ljspeech_step_90000/bdf06b9_ljspeech_step_90000
2023-06-23 03:48:08.648046: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-06-23 03:48:08.648086: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Loading model from /home/user/model/model3/TransformerTTS/model/mobel/bdf06b9_ljspeech_step_90000/bdf06b9_ljspeech_step_90000
2023-06-23 03:48:18.661162: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2023-06-23 03:48:18.661202: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2023-06-23 03:48:18.661224: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (ubuntu): /proc/driver/nvidia/version does not exist
2023-06-23 03:48:18.687299: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: git_hash mismatch: bdf06b9(config) vs 3638055(local).
Output wav under outputs/custom_text

标签:语音,23,--,py,TransformersTTS,user,TransformerTTS,tensorflow,TTS36
From: https://www.cnblogs.com/WordDealer/p/17499503.html

相关文章

  • Vue CLI 安装与创建 Vue 项目
    官网地址前提:已经安装过Node第一步:全局安装手脚架npminstall-g@vue/cli#ORyarnglobaladd@vue/cli 第二步:创建Vue项目(注意要切换到想创建项目的目录)vuecreatexxx 第三步:启动项目npmrunserver ......
  • 博客3
    课程管理系统及其他作业6-8前言:难度上:由于项目的逐渐增加,题目要求变多,测试点变多,客观而言是不断递增的。主观上而言,第一次,三次是比较难的。由于第一次是开始搭建一个程序,所以是相对难的,并且其给的测试点相对较少而且其测试点的覆盖面比较的窄,只能覆盖一部分的运行样例。第三次......
  • namp
    常用功能:-探测主机存活-扫描端口-探测主机操作系统信息-检测漏洞nmap常用的几个参数nmap-vip显示详细的扫描过程nmap-p ip 扫描指定端口nmap-Aip 全面扫描操作系统nmap-sPip 进行ping扫描主机存活nmap-Pn/-P0ip禁ping扫描nmap-sSip进行tcp......
  • 有关java的博客-3
    一、前言本次博客主是针对java学习第三阶段中的第6-8次PTA题目(成绩计算系列)的总结性博客,第三阶段的作业难度与第一阶段和第二阶段想必有所提高,对java的知识点考察主要集中在类的设计,正则表达式的运用,类的继承,多态,抽象类与接口。二、设计与分析1.课程成绩统计程序-11)类图 2......
  • P8477 「GLR-R3」春分 题解
    更好的阅读体验牛逼逼题。Subtask1直接暴力,每个实验配一块板。需要\(n^2\)块板。cout<<n*n<<'\n';for(inti=1;i<=n;++i){for(intj=1;j<=n;++j){cout<<"1"<<i<<''<<++c<......
  • 声誉: 来自尊敬的人,家人,My Lord。
    Durhamwascalledapoiticalhack,andoneDemocratlawmakersuggestedthathisreputatiohadbeensulliedbyallegedlyhelpingTrump,towhichanunbowedspecialcounselreplied:"MyconcernaboutmyreputationiswiththepeoplewhoIrespectandm......
  • 服务器带宽什么意思?服务器带宽多少合适?
    在规划网站和选择服务器配置时,需要根据业务预测情况来选择合适的服务器带宽。但是很多用户对于带宽没有概念。服务器带宽什么意思?服务器带宽多少合适?很多经验丰富的站长、开发人员在服务器带宽如何选择也是非常的模糊,今天我和你聊一下服务器带宽一、服务器带宽是什么意思?带宽是有线......
  • GoLang图形用户界面编程实战(GUI编程)—fyne框架(一)
    一、前言GUI编程:图形用户界面编程。使用fyne框架实现。ps(目的)====>>ps,美图秀秀GUI=========>>fyne框架msys2模拟linux,在msys2中安装fyne框架二、安装msys2(win模拟linux)下载地址1(阿里镜像):https://mirrors.aliyun.com/msys2/distrib/x86_64/?spm=a2c6h.25603864.0.0.4e6c1484CbwZd......
  • 指针详解
    一、指针运算给一个指针变量+1,通常情况下不是给指针本身+1,而是”迈一步“,步长根据指针的类型来确定。intmain(){ chara=1; intb=1; intarr[10]={0}; char*pa=&a; int*pb=&b; int(*parr)[10]=&arr; printf("%p\n",pa); printf("%p\n",pa+1);//......
  • k8s部署nacos
    首先创建数据库nacos执行以下语句CREATETABLE`config_info`(`id`bigint(20)NOTNULLAUTO_INCREMENTCOMMENT'id',`data_id`varchar(255)NOTNULLCOMMENT'data_id',`group_id`varchar(255)DEFAULTNULL,`content`longtextNOTNULLCOMME......