Solved by ptrblck in post #5 
              
              
                Usually loss functions expect the model output as the first argument and the target as the second. 
I don’t know which loss functions you are using, but you might want to swap the order of inputs.