DCASE-REPO / DESED_task

Domestic environment sound event detection task
MIT License
126 stars 67 forks source link

How to modified my own model to fit a 3-class problem? #59

Closed young169 closed 1 year ago

young169 commented 2 years ago

It gives me an error like:

ValueError: Using a target size (torch.Size([24, 10, 156])) that is different to the input size (torch.Size([24, 3, 156])) is deprecated. Please ensure they have the same size.

I already change the confs/default.yaml's nclass to 3.But the target size still seems to be 10, What else I should do?

turpaultn commented 2 years ago

Hi, Yeah, you have to change local/classes_dict too. I agree it's not very intuitive we should probably change the code to make it appear in the configuration file since the dataset is there too :)

young169 commented 2 years ago

Hi, Yeah, you have to change local/classes_dict too. I agree it's not very intuitive we should probably change the code to make it appear in the configuration file since the dataset is there too :)

It works! But ooops, within sed_trainer/validation_step function, it gives a new error:

audio, labels, padded_indxs, filenames = batch ValueError: not enough values to unpack (expected 4, got 3)

after debug, batch is a list contains three tensors. And the filenames meaning what? Or it is because of the lack of files? I just want to classify wav files to 3 class, and only strong labeled data is available. I split the whole data to train/test set. Can this repo be used for such classification regardless the lack of unlabeled sythesised and weak labeled data?

turpaultn commented 2 years ago

If you don't have the filenames, it is probably because in train_sed.py you changed the validation set and forgot to mention "return_filename=True" like here: https://github.com/DCASE-REPO/DESED_task/blob/f0161eb2a6766e3479494ca5e13a208d82a9c168/recipes/dcase2022_task4_baseline/train_sed.py#L156

From

https://github.com/DCASE-REPO/DESED_task/blob/f0161eb2a6766e3479494ca5e13a208d82a9c168/recipes/dcase2022_task4_baseline/train_sed.py#L152-L158

Yeah this repo can be used for that, you can change quite a lot of things because many things will be overkill for your problem. But otherwise the approach stands. I'm myself using this repo for a 4 classes problem actually.

turpaultn commented 1 year ago

It seems you got part of your answers @young169 , can we close this issue ?