mmdetection
mmdetection copied to clipboard
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
use cascade mask rcnn and add num_convs=2 to rpn_head, however, I get the following errors:
Environment
Could you provide a config so that we can reproduce the error?
Could you provide a config so that we can reproduce the error?
Hi, @ZwwWayne
I have same issue too, it can be fixed by changing this line to:
x = x + self.lateral_convs[i](feat)
Could you provide a config so that we can reproduce the error?
The config file I used is configs/simple_copy_paste/mask_rcnn_r50_fpn_syncbn-all_rpn-2conv_ssj_scp_32x2_270k_coco.py.
In my environment, the following fix resolves the error. https://github.com/open-mmlab/mmdetection/blob/ca11860f4f3c3ca2ce8340e2686eeaec05b29111/mmdet/models/dense_heads/rpn_head.py#L65
x = F.relu(x, inplace=False)
-
faster_rcnn_r50_fpn_1x_coco.py
: no error -
faster_rcnn_r50_fpn_1x_coco.py
,--cfg-options "model.rpn_head.num_convs=2"
: error -
faster_rcnn_r50_fpn_1x_coco.py
,--cfg-options "model.rpn_head.num_convs=2"
,x = F.relu(x, inplace=False)
: no error
Solov2 head returns the same problem for me. Has anyone fixed that yet?
Solov2 head returns the same problem for me. Has anyone fixed that yet?
Yeap, [here](https://github.com/open-mmlab/mmdetection/blob/ca11860f4f3c3ca2ce8340e2686eeaec05b29111/mmdet/models/dense_heads/solov2_head.py#:~:text=%2B%3D%20self.-,convs_all_levels,-%5Bi%5D( ) change to feature_add_all_level = feature_add_all_level + self.convs_all_levels[i](input_p)
This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.
This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.