IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> Espnet ASR Demo & Quantization Document -> 正文阅读

[人工智能]Espnet ASR Demo & Quantization Document

  • This is a document of how to run Espnet (v1) ASR Demo and its model quantization
  • Test enviroment:
UbuntuCUDAGCC
21.0411.611.2

Installation

Note: Please follow the original installation guide provided by Espnet. Only some notes below should be paid attention to.

Requirements

soxsndfileffmpegflac
installedinstallednot installednot installed

Install Kaldi

Exactly follow the installation guide
Notes:

  • The Kaldi installation includes two parts: 1. tools installation 2. src installation. Make sure install them all in order
  • Once installed, many .o binary files can be found in directories such as: <kaldi-root>\{featbin,fgmmbin,fstbin,etc.}

Install Espnet

Exactly follow the installation guide
Notes:

  • Kaldi should be linked into <espnet>/tools (check guide)
  • Option A) Setup Anaconda environment is choosen in this document, so a virtual enviroment espnet is created with python==3.8
  • Since the current CUDA version is 11.6, which is not compatible with pytorch 1.10.1, so espnet should be installed by $ make TH_VERSION=1.10.1 CUDA_VERSION=11.3, which specifies the version pytorch and CUDA
  • Custom tools in [Optional] Custom tool installation are not installed
  • install chainer in the espnet conda enviroment by pip install chainer==6.0.0 (cupy is not installed due to some errors)

Run ASR Demo

This demo is to decode (translate) .wav audio file into words

Notes: some

  1. Prepare the audio file
    eg. the test.wav file in espnet/utils
    Put the .wav file in espnet/egs/tedlium2/asr1
  2. Perform decoding
    a. cd espnet/egs/tedlium2/asr1 and source ./path.sh
    b. recog_wav.sh --models <downloaded-model> test.wav
    Notes: The default approach is to use godown package, which could cause a time out error due to the network disconnection. In this case, the model file, eg. model.streaming.v1.tar.gz, need to be downloaded manually from google drive (see Espnet readme)
    Then, modify the download_from_google_drive.sh file in espnet/utils directory as follows:
    a. create a variable manual_download_dir that specifies the path of the downloaded model file. eg. manual_download_dir="/home/glinttsd/espnet/egs/tedlium2/asr1/model.streaming.v1.tar.gz"
    b. replace the codes in line 46-47 with
    	if [ -f "$manual_download_dir" ]
    	then 
    	echo "File download locally"
    	decompress "${manual_download_dir}" "${download_dir}"
    	else
    	echo "File download from url: ${share_url}"
    	gdown --id "${file_id}" -O "${tmp}"
    	decompress "${tmp}" "${download_dir}"
    	fi
    
    which skips the download part and decompress the model file directly.

Model Quantization

To quantize the model from FP32 to INT8

Espnet provides dynamic quantization method through pytorch API.

To enable dynamic quantization, add the following codes in espnet/utils/recog_wav.sh file line 248-249

        --quantize-asr-model True \
        --quantize-dtype "qint8" \

Now we can perform decoding as described in the last section

More usage can be found here

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2022-04-04 12:11:32  更:2022-04-04 12:14:27 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2025年1日历 -2025/1/8 4:18:02-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码