when i excute train.py, i meet this problem : loss = inf.
then i find loc_loss = inf.Can anyone help me,thanks!
i meet the same problem
so am i
Me too, what's the problem?
Finally, i solved my problem by referring to the chapter Pull requests, there is a column named "Fix infinity in target boxes", the author suggeste to change the source code in layers/box_utils.py like this:
change original code: g_wh = torch.log(g_wh) / variances[1] to g_wh = torch.log(g_wh + 1e-10) / variances[1]
what you can try is decreasing the lr or increasing the batch size
This is because log calculation in box_utils.py.
In function "encode", you can add epsilon for preventing explosion.
For example,
eps = 1e-5
g_wh = (matched[:, 2:] - matched[:, :2]) / priors[:, 2:]
g_wh = torch.log(g_wh+eps) / variances[1]
This should be merged with the master branch
Most helpful comment
This is because log calculation in box_utils.py.
In function "encode", you can add epsilon for preventing explosion.
For example,
eps = 1e-5
g_wh = (matched[:, 2:] - matched[:, :2]) / priors[:, 2:]
g_wh = torch.log(g_wh+eps) / variances[1]