Missing nltk Dataset in ESPnet2 TTS Colab Notebook (Causes Error in Synthesis Step)
Author: JustinSabatiniCreated Mar 14, 2025Updated Mar 14, 2025
LabelsBugTTS
Describe the Bug: The ESPnet2 TTS Google Colab notebook does not include an explicit download step for the required nltk dataset.
During synthesis, users receive the following error if nltk has not already been configured in their Colab environment:
LookupError:
Resource averaged_perceptron_tagger_eng not found.
Please use the NLTK Downloader to obtain the resource:
>>> import nltk
>>> nltk.download('averaged_perceptron_tagger_eng')This issue is not present for all users because some Colab environments may have this dataset cached, but for new users, this breaks the synthesis step.
Basic environments:
- OS information: Google Colab (latest)
- Python version: 3.11 (Google Colab default)
- ESPnet version: Latest version from Colab install
- PyTorch version: 2.1.0 (Google Colab default)
To Reproduce Steps to reproduce the behavior:
- Open the ESPnet2 TTS Colab Demo.
- Run all steps up to the Synthesis section.
- If nltk dataset is missing, the error appears.
Proposed Fix:
- Add the following before the synthesis step:
import nltk
nltk.download('averaged_perceptron_tagger_eng')- Should I submit a PR for this fix?
Source: espnet/espnet