Even if it is not the good way to do it, I will check that output2 is not empty to do:



 rvandeghen:

class_loss2, reg_loss2 = model(input2, output2) # model is retinanet


such that I’m sure that there is always at least one annotation but i miss the fact that the focal loss should still perform the log-loss where every anchor is considered as background.
I guess that accumulate the gradients manually in train2 should not be a problem right ?