dni.pytorch icon indicating copy to clipboard operation
dni.pytorch copied to clipboard

volatile can only be set on leaf variables

Open yangze0930 opened this issue 8 years ago • 4 comments
trafficstars

Hi, Andrew

As I run your code, there prints a RuntimeError: 'volatile can only be set on leaf variables' in line 44 of train.py

self.backprop_grads[name].volatile = False

could you check it out?

Thanks

yangze0930 avatar Aug 18 '17 03:08 yangze0930

Same problem any solutions?

fliman avatar Oct 12 '17 08:10 fliman

adding the following seems to make it work: if self.backprop_grads[name].grad_fn == None: self.backprop_grads[name].volatile = False However there are still other issues

fliman avatar Oct 12 '17 08:10 fliman

will check it these days, I doubt that it's about the version of pytorch since this error didn't appear before.

andrewliao11 avatar Oct 15 '17 03:10 andrewliao11

agree that adding the following seems to make it work: if self.backprop_grads[name].grad_fn == None: self.backprop_grads[name].volatile = False

lkhoad avatar Nov 11 '17 14:11 lkhoad