Still learning myself, but I will try to help. What does your learner code look like? Did you try loss_func=F.cross_entropy?
That error looks like it’s trying to pass 4 arguments when it creates the L1Loss. Maybe try setting a breakpoint (import pdb; pdb.set_trace()) and stepping thru, sometimes that might help give some insight.
The problem with using F.cross_entropy is that is for classification problems. Mine is a Regression. You have 6 values that you want to predict for each image.
Your point on choice of loss function makes sense.
I remember watching a fast ai video that did multi prediction. The loss function needed to be customized, as you need to take the parameters and create a blended loss function. It was something like creating a loss function for each thing being predicted, then you create a macro function
combines them, and that’s what’s used. Unfortunately I couldn’t find which course lesson it was.
I think what you could do for now is create a custom function that takes 8 positional arguments, and pass that in as the loss function. Got that number from the error msg. Put a breakpoint inside and see what is passed in. I suspect it might be the different preds and targets, which is what would be your macro loss function, where you do the combining. During SGD, the loss needs to reflect all the things being predicted, so they can all improve.
Again, I am still learning, so sorry if this is not helpful
It was lesson 7 of practical deep learning for coders 2022. Yeah, thanks! I will need to do a bit more research in that regard. Don’t worry everything helps!!