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

One of the variables needed for gradient computation has been modified by an inplace operation #4

Open
jimmy-dq opened this issue Feb 6, 2021 · 4 comments

Comments

@jimmy-dq
Copy link

jimmy-dq commented Feb 6, 2021

Hi,
Thanks for your great work. I ran rocl_train.py with your default parameters and find one error output when executing loss.backward(), the error is:
_RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation.
I found the problem is in adv_loss. After we execute outputs = projector(model(inputs)), adv_loss cannot be backwarded due to the inplace operation. Appreciate for your help.

@immuntasir
Copy link

Hi, were you able to solve this?

@cfeng16
Copy link

cfeng16 commented Jul 3, 2021

Hi, I met the same problem, Have you solved it?

@ramithuh
Copy link

@immuntasir were you able to solve it ? 😃

@priyamdey
Copy link

priyamdey commented Oct 14, 2021

It runs fine with multiple gpus. Error pops up for single gpu run. Comment out the lines 88 to 100 which wraps the model with SyncBN & DDP. Also the init (line 47 to 52, although I haven't tried with keeping this intact). Accordingly, update the run command by removing the distributed part. It should work fine then.

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

5 participants