Closed wmjung closed 5 years ago
Hi Wonmo,
Have you ever tried to change nn.ReLU(inplace=True)
into nn.ReLU(inplace=False)
?
In thops.py
, squeeze_()
and scatter_()
could be problem too.
It seems that there are no other inplace operations in my code.
I cannot run codes these days. I will fix this later. You can try to modify the above three mentioned places first. Thanks.
Thank you for your reply. I'll try with those modifications :)
I tried to modify some places and run on my cpu, but failed to figure out the problem. I have no idea what happened. It could be a small bug. If you found something, please tell me. Thank you.
I was getting a similar error when using some of the code - looks like it was coming from the in-place ops in the coupling layers (e.g. z2 += z1). Just sent a PR to fix it.
@kolchinski Thanks a lot. @wmjung It seems the bugs are fixed.
Hi yujin, I'm applying generative flow on 3D model. Your pytorch implementation is helpful. Due to the memory size, I ran the code with batch size 1, then inplace operation error occurs like below. (it is okay with batch size 2 or 4)
"RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation"
I tried to figure out where this error comes from, but failed. Do you have any idea?
Thanks in advance Wonmo,