asteroid-team / asteroid

The PyTorch-based audio source separation toolkit for researchers
https://asteroid-team.github.io/
MIT License
2.21k stars 419 forks source link

Transfer learning of pretrained model on custom dataset #687

Closed thedragoncoder closed 8 months ago

thedragoncoder commented 8 months ago

I wanted to use the pretrained model for example
model = BaseModel.from_pretrained("JorisCos/ConvTasNet_Libri3Mix_sepclean_16k")
to train on my custom dataset ( using the concept of transfer learning).
1. I have used the dataset that looks exactly like libriMix, but I am unsure whether the model is picking up the weights of the pretrained model or if it is assigning the weights randomly.
2. https://github.com/asteroid-team/asteroid/blob/master/notebooks/00_GettingStarted.ipynb, In the following demo, if I replace the line
model = DPRNNTasNet(n_src=2)
with the line model = BaseModel.from_pretrained("JorisCos/ConvTasNet_Libri3Mix_sepclean_16k"), I am getting an error stating the following : image
Please guide me as to what is the right way of transfer learning, as well as, please provide me an insight as to why there is an error coming up.

Thank you in advance.

thedragoncoder commented 8 months ago

I found out why there was an error in pt2. I twas because the number of sources that was used is 3 in the pretrained model, while I had only two sources.

mpariente commented 8 months ago

Thanks for reporting your solution !