DESED_task icon indicating copy to clipboard operation
DESED_task copied to clipboard

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

Open young169 opened this issue 3 years ago • 3 comments

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?

young169 avatar Oct 12 '22 08:10 young169

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

turpaultn avatar Oct 12 '22 10:10 turpaultn

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?

young169 avatar Oct 13 '22 01:10 young169

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 avatar Oct 14 '22 07:10 turpaultn

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

turpaultn avatar Mar 01 '23 14:03 turpaultn