kuangliu / pytorch-retinanet

RetinaNet in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to solve 'ZeroDivisionError: float division by zero' problem?

b2220333 opened this issue · comments

My GPU memory is 2G.
Therefore, I use batch=1 to run this program.
However, I meet the error force me to stop.
What should I do to get similar result of this paper in my configuration?
Thank you~

Error:
Traceback (most recent call last):
File "./t.py", line 1098, in
train(epoch)
File "./t.py", line 1059, in train
loss = criterion(loc_preds, loc_targets, cls_preds, cls_targets)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "./t.py", line 984, in forward
print('loc_loss: %.3f | cls_loss: %.3f' % (loc_loss.data[0]/num_pos, cls_loss.data[0]/num_pos), end=' | ')
ZeroDivisionError: float division by zero