dscripka / openWakeWord

An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity.
Apache License 2.0
641 stars 61 forks source link

mix_clips_batch issue #188

Open pi19404 opened 2 months ago

pi19404 commented 2 months ago

I am using the function openwakeword.data.mix_clips_batch to mix foreground and background clips at desired snr levels . And getting the below error .

for batch in tqdm(mixing_generator, total=N_total//batch_size):

File "/workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages/tqdm/std.py", line 1181, in iter for obj in iterable: File "/workspace/f1/openwakeword_eval/openwakeword/data.py", line 466, in mix_clips_batch error_index = torch.from_numpy(np.where(mixed_clips_batch.max(dim=1) != 0)[0]) TypeError: _amax() got an unexpected keyword argument 'dim'

To resolve the issue I had to make changes in data.py file replace the line error_index = torch.from_numpy(np.where(mixed_clips_batch.max(dim=1) != 0)[0]) with error_index = torch.from_numpy(np.where(mixed_clips_batch.max(dim=1) != 0)[0])

dscripka commented 4 weeks ago

I'm not sure I understand the issue, it looks like your corrected line is the same?

Also, while mix_clips_batch still works, the official training process uses the augment_clips function, which should perform a bit better and be more efficient.