制作paddlespeech镜像全过程
1、起一个Ubuntu容器
docker pull ubuntu:18.04
docker run -itd --name pd_base ubuntu:18.04
2、在容器中进行安装部署
2.1 不安装conda
2.2 安装python3.10
https://blog.csdn.net/weixin_43935402/article/details/121416812
2.2.1 apt update
2.2.2安装依赖
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
2.2.3 下载离线python3.10tar包并安装
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
tar -zvxf Python-3.10.0.tgz
cd Python-3.10.0/
./configure --enable-optimizations
make
make install
2.2.4 更新python默认指向为python3.10
rm /usr/bin/python # 容器内没有python的话,这一步不需要做
ln -s /usr/local/bin/python3 /usr/bin/python
2.2.5 设置python环境变量
apt install vim
vi /root/.bashrc
加入: alias python=‘/usr/local/bin/python3’
source ~/.bashrc
2.3 下载build依赖
apt install build-essential
2.4 安装paddlespeech
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
pip install paddlespeech -i https://pypi.tuna.tsinghua.edu.cn/simple
2.5 执行报错,需要解决依赖问题
python
from paddlespeech.cli.tts.infer import TTSExecutor
执行from paddlespeech.cli.tts.infer import TTSExecutor报错
2.5.1
将nltk_data.tar.gz拷贝到容器/root目录下并解压
docker cp nltk_data.tar.gz 8ebb4a3d446b:/root
tar -zvxf nltk_data.tar.gz
2.5.2 ModuleNotFoundError: No module named ‘_lzma’
pip install lzma 获取不到
apt-get install liblzma-dev
安装完成后,在/root/Python3.10.0/目录下执行:
make
make install
问题顺利解决
2.6 执行flask_tts.py
pip换源
2.6.1 报错ModuleNotFoundError: No module named ‘gevent’
pip install gevent文章来源:https://www.toymoban.com/news/detail-422632.html
python flask_tts.py 启动成功文章来源地址https://www.toymoban.com/news/detail-422632.html
到了这里,关于部署paddleSpeech的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!