afa icon indicating copy to clipboard operation
afa copied to clipboard

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

Open parisafarboud opened this issue 2 years ago • 3 comments

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

parisafarboud avatar Nov 24 '22 22:11 parisafarboud

Hello, have you solved this problem?

tgyhhh avatar Mar 08 '23 06:03 tgyhhh

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)

parisafarboud avatar Mar 08 '23 13:03 parisafarboud

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

WQH-52 avatar Apr 22 '24 01:04 WQH-52