SA-SSD icon indicating copy to clipboard operation
SA-SSD copied to clipboard

RuntimeError: Output 0 of SplitBackward is a view and is being modified inplace.

Open msmekala opened this issue 2 years ago • 3 comments

Hello Everone! When i am trying to run python3 train.py ../configs/car_cfg.py

i get the following RunTimeError

"Traceback (most recent call last): File "tools/train.py", line 128, in main() File "tools/train.py", line 118, in main log_interval = cfg.log_config.interval File "/home/rlrc/Downloads/SA-SSD/tools/train_utils/init.py", line 99, in train_model log_interval = log_interval File "/home/rlrc/Downloads/SA-SSD/tools/train_utils/init.py", line 57, in train_one_epoch outputs = batch_processor(model, data_batch) File "/home/rlrc/Downloads/SA-SSD/tools/train_utils/init.py", line 29, in batch_processor losses = model(**data) File "/home/rlrc/anaconda3/envs/pcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/rlrc/Downloads/SA-SSD/mmcv/mmcv/parallel/data_parallel.py", line 50, in forward return super().forward(*inputs, **kwargs) File "/home/rlrc/anaconda3/envs/pcdet/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward return self.module(*inputs[0], **kwargs[0]) File "/home/rlrc/anaconda3/envs/pcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "/home/rlrc/Downloads/SA-SSD/mmdet/models/detectors/base.py", line 79, in forward return self.forward_train(img, img_meta, **kwargs) File "/home/rlrc/Downloads/SA-SSD/mmdet/models/detectors/single_stage.py", line 103, in forward_train bbox_score = self.extra_head(conv6, guided_anchors) File "/home/rlrc/anaconda3/envs/pcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in call_impl return forward_call(*input, **kwargs) File "/home/rlrc/Downloads/SA-SSD/mmdet/models/single_stage_heads/ssd_rotate_head.py", line 439, in forward (xs, ys) = self.gen_grid_fn(ga[:, [0, 1, 3, 4, 6]]) File "/home/rlrc/Downloads/SA-SSD/mmdet/models/single_stage_heads/ssd_rotate_head.py", line 380, in gen_sample_grid xg = xg.unsqueeze(-1).expand(N, *window_size) RuntimeError: Output 0 of SplitBackward is a view and is being modified inplace. This view is an output of a function that returns multiple views. Inplace operators on such views is forbidden. You should replace the inplace operation by an out-of-place one."

My Torch version is 1.9.0+cu102

Thanks a lot for your help and support in advance

msmekala avatar May 17 '22 16:05 msmekala

1.9.0+cu102

Thanks a lot for your help and support in

Hi,did you solve it? Thanks a lot.

sylivahf avatar Jul 28 '22 01:07 sylivahf

I had the same problem with rtx3090+cuda11.1+torch1.7.0+spconv 2.2(also has error with spconv 1.0)\

How do you solve the problem? Thanks

AOOOOOA avatar Oct 03 '22 03:10 AOOOOOA

I managed to solve this problem by modifying the code as following:

xg1, yg1, wg1, lg1, rg1 = torch.split(box, 1, dim=-1) xg=xg1.clone() yg=yg1.clone() wg=wg1.clone() lg=lg1.clone() rg=rg1.clone()

Chenghao-Wen avatar May 16 '23 07:05 Chenghao-Wen