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: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256]] is at version 3; expected version 2 instead #19

Open
parisafarboud opened this issue Nov 24, 2022 · 3 comments

Comments

@parisafarboud
Copy link

parisafarboud commented Nov 24, 2022

I got Runtime error in backward while running the code with any versions of python and pytorch, how should I solve that, and which versions satisfy?

2022-11-25

@tgyhhh
Copy link

tgyhhh commented Mar 8, 2023

Hello, have you solved this problem?

@parisafarboud
Copy link
Author

Hello, have you solved this problem?

Hi, yes I've solved the problem. The problem was because I was training on single GPU and I commented the line below:
wetr = DistributedDataParallel(wetr, device_ids=[args.local_rank], find_unused_parameters=True)

@WQH-52
Copy link

WQH-52 commented Apr 22, 2024

Hello, how can I solve this problem? I am also training on a single GPU. @parisafarboud

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

3 participants