训练和测试需 git clone 安装,因为要从其他作者处获取 ctc_decoders、rnnt_loss 等依赖;项目用 uv 管理,要求 Python 3.12 或 3.13,与徽章上的 >=3.8 不一致;TPU 安装脚本会被后续 uv sync 覆盖,需重新运行。
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
git clone https://github.com/TensorSpeech/TensorFlowASR.git
cd TensorFlowASR
uv syncREADME 未给出具体显存要求;默认 uv sync 安装的 TensorFlow 可跑 CPU 与 Apple Silicon,NVIDIA GPU 需装 cuda extra,Cloud TPU 需运行 scripts/install_tpu.sh。
基于 TensorFlow 2 的语音识别框架,内置多种主流 ASR 架构,可训练并转成 TFLite 部署
基于 TensorFlow 2 的端到端语音识别框架,支持 Conformer、ContextNet、DeepSpeech2 等模型,可做字符或子词级多语言识别与流式推理。
核心能力
- 实现 Conformer、ContextNet、RNNT、DeepSpeech2、Jasper 等模型
- 支持 CTC 与 Transducer 两类端到端训练损失
- 提供贪心与 beam search 解码,含 ALSD++ Transducer 搜索
- 可将模型转为 TFLite,直接从音频信号输出文本与 token
- ASREngine 单次加载模型,多会话共享推理
容易踩的坑
- 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
- Inference singleton with dynamic batching (
- 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
-
Beam search test result (
a0480fb) -
Device scope (
9379765) -
Github actions (
aedec2f) -
Github actions (
284c444) -
Install tpu (
5f365b0) -
Kaggle lm train define accelerator (
57ede0e) -
Kenlm training on kaggle (
a3b3b85) -
Lm training (
802394b) -
Memory for multi-head attention layer (
7076e72) -
Refactor lm (
f057eff) -
Split lm dataset, update kaggle (
07183ef) -
Step per epoch (
409d709) -
Streaming should have states for conv and mha layers (
74b5313) -
Text path (
8885de9) -
Tf 2.19 to enable tf.lite flex delegate ops (
e2228bf) -
Tflite convert and run (
ab6f29c) -
Tflite convert metadata (
586c36f) -
Tflite converter (
1161b80) -
Tmp dir for kenlm (
4bc7a41) -
Train lm loss (
05476c5) -
Train lm model upload checkpoint (
9a8dbdb) -
Unittests for tflite (
fbe4c91) -
Update lm dataset and training (
6aa7088) -
Update lm dataset and training (
78b3544) -
Update streaming with kv-cache (
cf90972) -
Update test with beam search lm (
29c680e) -
Update tests (
9a27ccd)
Chores
-
Config (
610a696) -
Config ([
179da42](https://github.com/TensorSpeech/TensorFlowASR/commit/179da42200898428ca94198119276
-
- v3.0.02025-06-11 · 2025-06-11 15:07 UTC
查看更新说明
What's Changed
- chore: fix features source by @emmanuel-ferdman in https://github.com/TensorSpeech/TensorFlowASR/pull/293
- Keras 3, Kaggle, CLI, Streaming by @nglehuy in https://github.com/TensorSpeech/TensorFlowASR/pull/295
New Contributors
- @emmanuel-ferdman made their first contribution in https://github.com/TensorSpeech/TensorFlowASR/pull/293
Full Changelog: https://github.com/TensorSpeech/TensorFlowASR/compare/v2.1.0...v3.0.0
- v2.1.0TensorFlowASR v2.1.02024-06-09 · 2024-06-09 15:14 UTC
查看更新说明
- v2.0.1TensorFlowASR v2.0.12024-05-19 · 2024-05-19 17:34 UTC
查看更新说明
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
What's New?
Table of Contents
- What's New?
- Table of Contents
- :yum: Supported Models
- Installation
- Training & Testing Tutorial
- Features Extraction
- Decoders
- Inference
- Augmentations
- TFLite Convertion
- Pretrained Models
- Corpus Sources
- How to contribute
- References & Credits
- Contact
: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
- Conformer Transducer (Reference: https://arxiv.org/abs/2005.08100) See examples/models/transducer/conformer
- Streaming Conformer (Reference: http://arxiv.org/abs/2010.11395) See examples/models/transducer/conformer
- ContextNet (Reference: http://arxiv.org/abs/2005.03191) See examples/models/transducer/contextnet
- RNN Transducer (Reference: https://arxiv.org/abs/1811.06621) See examples/models/transducer/rnnt
- Deep Speech 2 (Reference: https://arxiv.org/abs/1512.02595) See examples/models/ctc/deepspeech2
- Jasper (Reference: https://arxiv.org/abs/1904.03288) See examples/models/ctc/jasper
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:
| Extra | Contents |
|---|---|
| (none) | tensorflow + tensorflow-text, works on CPU and Apple Silicon |
cuda | tensorflow[and-cuda] for NVIDIA GPUs |
dev | pytest, 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-tpuships its owntensorflowdistribution and overwrites the base one. This matches the previoussetup.sh tpubehaviour, which uninstalledtensorflowand force-installedtensorflow-tpuover it.
Running in a container
docker-compose up -d
Training & Testing Tutorial
- For training, please read tutorial_training
- For testing, please read tutorial_testing
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
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
Pretrained Models
See the results on each example folder, e.g. ./examples/models//transducer/conformer/results/sentencepiece/README.md
Corpus Sources
English
| Name | Source | Hours |
|---|---|---|
| LibriSpeech | LibriSpeech | 970h |
| Common Voice | https://commonvoice.mozilla.org | 1932h |
Vietnamese
| Name | Source | Hours |
|---|---|---|
| Vivos | https://ailab.hcmus.edu.vn/vivos | 15h |
| InfoRe Technology 1 | InfoRe1 (passwd: BroughtToYouByInfoRe) | 25h |
| InfoRe Technology 2 (used in VLSP2019) | InfoRe2 (passwd: BroughtToYouByInfoRe) | 415h |
| VietBud500 | https://huggingface.co/datasets/linhtran92/viet_bud500 | 500h |
How to contribute
- Fork the project
- Install for development
- Create a branch
- Make a pull request to this repo
References & Credits
- NVIDIA OpenSeq2Seq Toolkit
- https://github.com/noahchalifour/warp-transducer
- Sequence Transduction with Recurrent Neural Network
- End-to-End Speech Processing Toolkit in PyTorch
- https://github.com/iankur/ContextNet
Contact
Huy Le Nguyen
Email: [email protected]