pytorch_solov2 icon indicating copy to clipboard operation
pytorch_solov2 copied to clipboard

请问大家有遇到 inplace operation 错误呀

Open ViatorSun opened this issue 2 years ago • 2 comments

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1, 128, 192, 120]], which is output 0 of ReluBackward 0, is at version 3; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

ViatorSun avatar May 16 '22 08:05 ViatorSun

看起来pytorch版本的问题

ABlueLight avatar May 27 '22 02:05 ABlueLight

谢谢答复,除了将Pytorch版本降低之外,修改 mask_feat_head.py 里面的 forward 函数中的 feature_add_all_level += self.convs_all_levels[i](input_p) 改为 feature_add_all_level = self.convs_all_levels[i](input_p) + feature_add_all_level 就可以解决 inplace operation 问题

ViatorSun avatar Jun 07 '22 14:06 ViatorSun