One RuntimeError occurred when I tried to train SSD on VOC dataset.
You may find more reference from Pytorch Forum:
https://discuss.pytorch.org/t/encounter-the-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/836
In my case, I changed the x variable in SSD.py and it worked for me. Hope helps for you!
Line 25 in model/SSD.py
x /= (x.pow(2).sum(dim=1, keepdim=True).sqrt() + 1e-10)
to
x /= (x.clone().pow(2).sum(dim=1, keepdim=True).sqrt() + 1e-10)
You may face same issue when implement other model like SSD512, you can debug by your self with detection feature in pytorch. Change codes in train.py:
Line 268 in train.py
train()
to
with torch.autograd.set_detect_anomaly(True):
train()
for more information:
https://github.com/pytorch/pytorch/issues/15803
One RuntimeError occurred when I tried to train SSD on VOC dataset. You may find more reference from Pytorch Forum: https://discuss.pytorch.org/t/encounter-the-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/836 In my case, I changed the x variable in SSD.py and it worked for me. Hope helps for you! Line 25 in model/SSD.py x /= (x.pow(2).sum(dim=1, keepdim=True).sqrt() + 1e-10) to x /= (x.clone().pow(2).sum(dim=1, keepdim=True).sqrt() + 1e-10) You may face same issue when implement other model like SSD512, you can debug by your self with detection feature in pytorch. Change codes in train.py: Line 268 in train.py train() to with torch.autograd.set_detect_anomaly(True): train() for more information: https://github.com/pytorch/pytorch/issues/15803