Hi ! First of all thanks to all the people that made this course so awesome.
Following lesson 1, I decided to create my own dataset made of skiers and snowboards to see if I could teach resnet34 to recognize them. It worked pretty well with an accuracy around 91% (My very basic render app is available here if you want to give it a try)
Going on with the course, I decided to spice things up, adding images of monoskiers, ski jumpers and cross country skiers to my dataset. I trained a new resnet34 and obtained an accuracy around 75%(with monoskiers being class with the worst performance, as I expected). Looking more precisely at the results, I saw that there was more confusion between skiers and snowboards in that second model than there was in the first one. The usage of transfert learning in lesson 3 (for the planet dataset) made me think that there should be a way to inherit the knowledge acquired in my first model and apply it to the second.
I naively tried doing
learn.data = data5 (where learn is the first model and data5 is the data bunch for the 5 class dataset) and then went on with the fitting but it logically failed because the number of classes is different in the two classification problems hence you can’t copy the weight’s values from the last layer.
My question is the following : Is there a way to copy only a portion of the weights from one network to the other ? I assume there is but can’t find the correct way to do it.
Thanks a lot for your help !