Hello,
Jan 15, 2018 - Fast.ai library will automatically switch into multi-label mode if there is more than one label. So you do not have to do anything. But here is what. Has anyone here worked on a multi-label classification problem. My problem is with the accuracy score printout during evaluation phase.
Describe the bug
I am trying to train a model that has multiple labels per image similar to the Planet: Understanding the Amazon from Space dataset on Kaggle and discussed in the lecture. The exact dataset that I am using is from the new Human Protein Atlas Image Classification competition that was just released a few days ago.
I have managed to load the data into an ImageMultiDataset object and was able to use some of the convenience functions to view the data. So I believe that is set up correctly. Then I set up my Learner, a run learner.fit(1) and returns an error saying that it expected a Long tensor but received a Float tensor at the evaluation of the loss function.
To Reproduce
And here is the output:
Then I create my ConvLearner:
Then finally try to train it and this is where the problem arises:
I have had this error before when training a model with just base Pytorch and I forget to convert my ground truth labels to Long tensors before passing them into a crossentropy loss function. I am not exactly sure however how the conversion works within the fastai library, or if I need to convert it myself somehow.
Thank you in advanced