Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
msmekala opened this issue May 17, 2022 · 3 comments

Comments

@msmekala
Copy link

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

@sylivahf
Copy link

1.9.0+cu102

Thanks a lot for your help and support in

Hi,did you solve it? Thanks a lot.

@AOOOOOA
Copy link

AOOOOOA commented Oct 3, 2022

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

@Chenghao-Wen
Copy link

Chenghao-Wen commented May 16, 2023

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants