LearnedVector / A-Hackers-AI-Voice-Assistant

A hackers AI voice assistant, built using Python and PyTorch.
https://www.youtube.com/playlist?list=PL5rWfvZIL-NpFXM9nFr15RmEEh4F4ePZW
MIT License
1.01k stars 360 forks source link

KeyError: 'D' #30

Open pietmlr opened 3 years ago

pietmlr commented 3 years ago

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 commented 3 years ago

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..

NoCodeAvaible commented 3 years ago

Hey mate did you fix it?

pietmlr commented 3 years ago

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

NoCodeAvaible commented 3 years ago

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

NoCodeAvaible commented 3 years ago

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

Jochen-sys commented 3 years ago

@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.

CracKCatZ commented 3 years ago

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

Jochen-sys commented 3 years ago

@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)