AttributeError: 'exceptions.KeyError' object has no attribute 'with_traceback'

I have been trying to train the DeepSpeech model for Chinese language. I have changed the “alphabet.txt” file as per the transcription of the audio. I have downloaded the dataset from Mozilla’s CommonVoice corpus. I am trying to bring this data into a form that DeepSpeech understands since the dataset after extraction consists of *.tsv files and .mp3 files (by running (bin/import_cv2.py) -

kartikey@ubuntu:~/DeepSpeech$ bin/import_cv2.py data/Chinese --filter_alphabet data/alphabet.txt
Loading TSV file: /home/kartikey/DeepSpeech/data/Chinese/train.tsv
Saving new DeepSpeech-formatted CSV file to: data/Chinese/clips/train.csv
Importing mp3 files…
Traceback (most recent call last):
File “bin/import_cv2.py”, line 166, in
_preprocess_data(PARAMS.tsv_dir, AUDIO_DIR, label_filter_fun, PARAMS.space_after_every_character)
File “bin/import_cv2.py”, line 43, in _preprocess_data
_maybe_convert_set(input_tsv, audio_dir, label_filter, space_after_every_character)
File “bin/import_cv2.py”, line 101, in _maybe_convert_set
for i, _ in enumerate(pool.imap_unordered(one_sample, samples), start=1):
File “/usr/lib/python2.7/multiprocessing/pool.py”, line 673, in next
raise value
AttributeError: ‘exceptions.KeyError’ object has no attribute ‘with_traceback’
Progress |######################################################| 100% completed

Also, do I need to change any other file for training DeepSpeech model for Chinese language except “alphabet.txt”.

Please help me out with this.

Are you sure you properly installed dependencies ? Also, training on Python 2.7 is not supported anymore (several dependencies did drop support).

@lissyx I was able to run the command with Python3 as you suggested.
Thank you :slight_smile:

1 Like