KeyError How to solve it?


(Manuelgarciamoreno326598) #1

I receive this error

Traceback (most recent call last):
File “DeepSpeech.py”, line 1988, in
tf.app.run(main)
File “/home/manuel/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py”, line 125, in run
_sys.exit(main(argv))
File “DeepSpeech.py”, line 1944, in main
train()
File “DeepSpeech.py”, line 1468, in train
hdf5_cache_path=FLAGS.train_cached_features_path)
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/preprocess.py”, line 68, in preprocess
out_data = pmap(step_fn, source_data.iterrows())
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/preprocess.py”, line 13, in pmap
results = pool.map(fun, iterable)
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 644, in get
raise self._value
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 119, in worker
result = (True, func(*args, **kwds))
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 44, in mapstar
return list(map(*args))
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/preprocess.py”, line 22, in process_single_file
transcript = text_to_char_array(file.transcript, alphabet)
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/text.py”, line 40, in text_to_char_array
return np.asarray([alphabet.label_from_string© for c in original])
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/text.py”, line 40, in
return np.asarray([alphabet.label_from_string© for c in original])
File “/home/manuel/Descargas/Speech_recognition/prueba/DeepSpeech/util/text.py”, line 30, in label_from_string
return self._str_to_label[string]
KeyError: ‘ó’

both alphabet.txt and my file with the vocabulary, in this case vocabulary.txt, are encoded in us-ascii


(Michael Henretty) #2

hi @manuelgarciamoreno326598, thanks for your question.

please post this to the Deep Speech discourse channel instead of Common Voice:

https://discourse.mozilla.org/c/deep-speech