Skip to content

windows环境安装

hnluo edited this page Feb 8, 2023 · 19 revisions

1、安装anaconda:

  1. anaconda历史版本下载地址,选择相应的版本安装:https://repo.anaconda.com/archive/
  2. 安装anaconda时注意勾选环境变量:

  1. 安装完成后,点击anaconda prompt命令窗口:

运行命令: conda config --set show_channel_urls yes 打开user下文件 .condarc,把里面的内容替换为清华源: channels:

  1. 生成虚拟环境:

conda create -n funasr python=3.7 conda activate funasr

**2、安装pytorch **

参考地址:https://pytorch.org/get-started/locally/: CPU: conda install pytorch torchvision torchaudio cpuonly -c pytorch GPU(确认本地cuda版本): conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia

3、modelscope:

暂无;

4、git安装:

详见 [Download for Windows](https://git-scm.com/download/win);
使用 git bash clone funasr;

https://aliyuque.antfin.com/lzr265946/gqqb6z/zqglpgpv2pcisg36?singleDoc# 《FunASR for Windows》

5、funasr安装:

git clone https://github.com/alibaba/FunASR.git && cd FunASR pip install --editable ./

  • 报错1:
    • ctc-segmentation (因为没有编译环境,所以编译失败了)

Building wheel for ctc-segmentation (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for ctc-segmentation (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-37 creating build\lib.win-amd64-cpython-37\ctc_segmentation copying ctc_segmentation\ctc_segmentation.py -> build\lib.win-amd64-cpython-37\ctc_segmentation copying ctc_segmentation\partitioning.py -> build\lib.win-amd64-cpython-37\ctc_segmentation copying ctc_segmentation_init_.py -> build\lib.win-amd64-cpython-37\ctc_segmentation running build_ext building 'ctc_segmentation.ctc_segmentation_dyn' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ctc-segmentation

  • 解决方案:

安装Microsoft Build Tools for Visual Studio,在 Build Tools 中,安装“使用C++的桌面开发”并确保安装详细信息的两项勾选:MSVC生成工具、windows SDK

modelscope+funasr

1、安装conda环境和pytorch:

conda create -n modelscope python=3.7 conda activate modelscope conda install pytorch torchvision torchaudio cpuonly -c pytorch 详细安装步骤见上; ,

2、下载Maas-lib:

git clone http://gitlab.alibaba-inc.com/Ali-MaaS/MaaS-lib.git cd MaaS-lib git checkout dev/audio_dep

3、安装Maas-lib依赖:

  1. 先安装MaaS-lib框架的依赖,运行: pip install -r requirements.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  2. 然后安装asr的依赖,运行:pip install -r requirements/audio_asr.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

后续maas同学会支持 pip install ".[audio_xxx]" 这种安装方式

4、测试

在MaaS-lib目录下可以运行demo脚本 python demo.py

docker+funasr

docker安装

不同平台docker安装详见 https://docs.docker.com/desktop/

funasr镜像

CPU镜像:

lyblsgo/funasr:0.1.7-torch1.13.1-py3.7-ubuntu20.04

GPU镜像:

lyblsgo/funasr:0.1.7-torch1.13.1-cu116-py3.7-ubuntu20.04 docker pull lyblsgo/funasr:0.1.7-torch1.13.1-py3.7-ubuntu20.04 docker run -it lyblsgo/funasr:0.1.7-torch1.13.1-py3.7-ubuntu20.04 /bin/bash

Clone this wiki locally