pytorch-ewc icon indicating copy to clipboard operation
pytorch-ewc copied to clipboard

Fisher update

Open Sharut opened this issue 5 years ago • 1 comments

I am trying to run EWC on my dataset with resnet50 model. While updating the fisher matrix using your function, My code says Cuda out of memory due to "log_liklihoods.append(output[:, target])" in the code. I read this "https://stackoverflow.com/questions/59805901/unable-to-allocate-gpu-memory-when-there-is-enough-of-cached-memory" and figured out the problem using 'detach()'. After doing detach etc, I get an error: RuntimeError: One of the differentiated Tensors appears to not have been used in the graph. Set allow_unused=True if this is the desired behavior. To further solve this, I set "allow_unused=True" in autograd. As a result, all my gradients go to 0. Why is this happening?

Sharut avatar Feb 20 '20 18:02 Sharut

Did you have a solution? I have a same problem about this.

Gary-code avatar Nov 30 '23 08:11 Gary-code