A-Hackers-AI-Voice-Assistant icon indicating copy to clipboard operation
A-Hackers-AI-Voice-Assistant copied to clipboard

KeyError: 'D'

Open pietmlr opened this issue 5 years ago • 8 comments

I constantly getting this error: `During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/pietmuller/Dokumente/code/sr.venv/speechrecognition/neuralnet/dataset.py", line 110, in getitem label = self.text_process.text_to_int_sequence(self.data['text'].iloc[idx]) File "/Users/pietmuller/Dokumente/code/sr.venv/speechrecognition/neuralnet/utils.py", line 51, in text_to_int_sequence ch = self.char_map[c] KeyError: 'D'` I didn't change anything in the utils.py file. I'm also wondering why it says that there is a KeyError with the character: "D". In the variable char_map_str (in utils.py) is no capital D mentioned. Also I want to train it on a common voice dataset (German to be exact)

It' not only 'D', it's 'D' and 'E' alternately but no other characters...

pietmlr avatar Nov 27 '20 16:11 pietmlr

Okay I could fix this by adding some characters to the map and adding .lower() at the and of the label variable in dataset.py But now it says that my spectrograms are to big..

pietmlr avatar Nov 27 '20 17:11 pietmlr

Hey mate did you fix it?

NoCodeAvaible avatar Mar 05 '21 11:03 NoCodeAvaible

@NoCodeAvaible No, I couldn't, but now I am building my own automatic speech recognition system in Keras/Tensorflow.

pietmlr avatar Mar 05 '21 13:03 pietmlr

Fixed it! Add me on Discord I'am german too so I can tell u everythink about it:) Name: SheeeshForce1#8083

NoCodeAvaible avatar Mar 16 '21 19:03 NoCodeAvaible

If you not german I could tell you more about this because the KeyError will occur even if you lowercase. But in a different way

NoCodeAvaible avatar Mar 16 '21 19:03 NoCodeAvaible

@NoCodeAvaible How did you fix the error? I fixed the KeyError by changing the sentence to only lowercase letters, but I didn't fix the spectrogram which is too big. So I would be very interested how you did that.

Jochen-sys avatar Apr 12 '21 19:04 Jochen-sys

@Jochen-sys it's pretty late for me I will tell you tommorow:)

CracKCatZ avatar Apr 12 '21 19:04 CracKCatZ

@CracKCatZ Can you tell me now? I originally thought I would have fixed it, but it doesn't allow the big letters. (I don't get any error, but it's not liking the big letters)

Jochen-sys avatar May 11 '21 18:05 Jochen-sys