TensorFlowASR

TensorSpeechApache-2.0活跃维护

基于 TensorFlow 2 的端到端语音识别框架,支持 Conformer、ContextNet、DeepSpeech2 等模型,可做字符或子词级多语言识别与流式推理。

:zap: TensorFlowASR: Almost State-of-the-art Automatic Speech Recognition in Tensorflow 2. Supported languages that can use characters or subwords

v3.1.1发布于 2026-09-24 13:57 UTC1,017star238fork同步于 2026-11-10 05:57 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/TensorSpeech/TensorFlowASR.git
cd TensorFlowASR
uv sync
硬件要求按 README 说明

README 未给出具体显存要求;默认 uv sync 安装的 TensorFlow 可跑 CPU 与 Apple Silicon,NVIDIA GPU 需装 cuda extra,Cloud TPU 需运行 scripts/install_tpu.sh。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 TensorFlow 2 的语音识别框架,内置多种主流 ASR 架构,可训练并转成 TFLite 部署

基于 TensorFlow 2 的端到端语音识别框架,支持 Conformer、ContextNet、DeepSpeech2 等模型,可做字符或子词级多语言识别与流式推理。

核心能力

  • 实现 Conformer、ContextNet、RNNT、DeepSpeech2、Jasper 等模型
  • 支持 CTC 与 Transducer 两类端到端训练损失
  • 提供贪心与 beam search 解码,含 ALSD++ Transducer 搜索
  • 可将模型转为 TFLite,直接从音频信号输出文本与 token
  • ASREngine 单次加载模型,多会话共享推理

容易踩的坑

训练和测试需 git clone 安装,因为要从其他作者处获取 ctc_decoders、rnnt_loss 等依赖;项目用 uv 管理,要求 Python 3.12 或 3.13,与徽章上的 >=3.8 不一致;TPU 安装脚本会被后续 uv sync 覆盖,需重新运行。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.1.1
  1. v3.1.1最新正式版2026-09-24 · 2026-09-24 13:57 UTC

    v3.1.1 (2026-09-24)

    This release is published under the Apache-2.0 License.

    Bug Fixes

    • Inference singleton with dynamic batching (dc52432)

    Detailed Changes: v3.1.0...v3.1.1

  2. v3.1.02026-09-24 · 2026-09-24 06:57 UTC
    查看更新说明

    v3.1.0 (2026-09-24)

    This release is published under the Apache-2.0 License.

    Bug Fixes

    Chores

  3. v3.0.02025-06-11 · 2025-06-11 15:07 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/TensorSpeech/TensorFlowASR/compare/v2.1.0...v3.0.0

  4. v2.1.0TensorFlowASR v2.1.02024-06-09 · 2024-06-09 15:14 UTC
    查看更新说明
  5. v2.0.1TensorFlowASR v2.0.12024-05-19 · 2024-05-19 17:34 UTC
    查看更新说明

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    What's New?

    Table of Contents

    :yum: Supported Models

    Baselines

    • Transducer Models (End2end models using RNNT Loss for training, currently supported Conformer, ContextNet, Streaming Transducer)
    • CTCModel (End2end models using CTC Loss for training, currently supported DeepSpeech2, Jasper)

    Publications

    Installation

    For training and testing, you should use git clone for installing necessary packages from other authors (ctc_decoders, rnnt_loss, etc.)

    TensorFlowASR uses uv as its package manager and requires python 3.12 or 3.13.

    A plain uv sync installs tensorflow + tensorflow-text, which is all that CPU and Apple Silicon need. Accelerators are opt-in extras:

    git clone https://github.com/TensorSpeech/TensorFlowASR.git
    cd TensorFlowASR
    uv sync                 # CPU / Apple Silicon
    uv sync --extra cuda    # NVIDIA GPU
    uv sync --extra dev     # add the development tooling
    

    Extras are declared in pyproject.toml:

    ExtraContents
    (none)tensorflow + tensorflow-text, works on CPU and Apple Silicon
    cudatensorflow[and-cuda] for NVIDIA GPUs
    devpytest, ruff, pre-commit, plotting and export tooling

    Run commands inside the environment with uv run, e.g. uv run pytest or uv run tensorflow_asr --help.

    Cloud TPU is not an extra:

    uv sync && ./scripts/install_tpu.sh
    

    tensorflow-tpu ships its own tensorflow distribution, and tensorflow is a base dependency, so an extra adding it would install both and leave whichever landed last in place. The script uninstalls the stock build first, then installs the TPU one. Re-run it after any later uv sync, which puts the stock tensorflow back.

    TPU note: tensorflow-tpu ships its own tensorflow distribution and overwrites the base one. This matches the previous setup.sh tpu behaviour, which uninstalled tensorflow and force-installed tensorflow-tpu over it.

    Running in a container

    docker-compose up -d
    

    Training & Testing Tutorial

    FYI: Keras builtin training uses infinite dataset, which avoids the potential last partial batch.

    See examples for some predefined ASR models and results

    Features Extraction

    See features_extraction

    Decoders

    Greedy and beam search decoding for CTC and Transducer models, including the ALSD++ transducer beam search

    See decoders

    Inference

    ASRInference transcribes one stream with either a checkpoint or an exported tflite model, in one pass or streaming chunk by chunk. All sessions on one model share one ASREngine, which loads the model once and decodes many sessions per call, for example one session per websocket in a server

    See inferences, and examples/inferences for runnable scripts including a live microphone

    Augmentations

    See augmentations

    TFLite Convertion

    After converting to tflite, the tflite model is like a function that transforms directly from an audio signal to text and tokens

    See tflite_convertion

    Pretrained Models

    See the results on each example folder, e.g. ./examples/models//transducer/conformer/results/sentencepiece/README.md

    Corpus Sources

    English

    NameSourceHours
    LibriSpeechLibriSpeech970h
    Common Voicehttps://commonvoice.mozilla.org1932h

    Vietnamese

    NameSourceHours
    Vivoshttps://ailab.hcmus.edu.vn/vivos15h
    InfoRe Technology 1InfoRe1 (passwd: BroughtToYouByInfoRe)25h
    InfoRe Technology 2 (used in VLSP2019)InfoRe2 (passwd: BroughtToYouByInfoRe)415h
    VietBud500https://huggingface.co/datasets/linhtran92/viet_bud500500h

    How to contribute

    1. Fork the project
    2. Install for development
    3. Create a branch
    4. Make a pull request to this repo

    References & Credits

    1. NVIDIA OpenSeq2Seq Toolkit
    2. https://github.com/noahchalifour/warp-transducer
    3. Sequence Transduction with Recurrent Neural Network
    4. End-to-End Speech Processing Toolkit in PyTorch
    5. https://github.com/iankur/ContextNet

    Contact

    Huy Le Nguyen

    Email: [email protected]