Dear @BobLiu20 , thanks for sharing your code. It's wonderful, however I think there might be a bug in the loss related block of training.py:
losses = [[]] * len(losses_name)
for i in range(3):
_loss_item = yolo_losses[i](outputs[i], labels)
for j, l in enumerate(_loss_item):
losses[j].append(l)
losses = [sum(l) for l in losses]
loss = losses[0]
I suppose the losses should be a 7 3 list, but actually it appear to be of the size 7 21. Every time losses[j].append(l) is executed, l is appended to each sublist of losses. And after losses = [sum(l) for l in losses] is done, all the elements of 'losses' are identical. I doubt that this behavior is not like what the code is supposed to act. If I'm right, I think this issue can be addressed by changing losses = [[]] * len(losses_name) into:
losses = []
for i in range(len(losses_name)):
losses.append([])
Dear @BobLiu20 , thanks for sharing your code. It's wonderful, however I think there might be a bug in the loss related block of training.py:
I suppose the
losses
should be a 7 3 list, but actually it appear to be of the size 7 21. Every timelosses[j].append(l)
is executed,l
is appended to each sublist oflosses
. And afterlosses = [sum(l) for l in losses]
is done, all the elements of 'losses' are identical. I doubt that this behavior is not like what the code is supposed to act. If I'm right, I think this issue can be addressed by changinglosses = [[]] * len(losses_name)
into:or something like that.