I am getting the following error.

RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.

I am moving my code from 0.2.0.4 to 0.4.1.  With a few checks for version the code runs on both up to a few epochs, but eventually 0.4.1 fails with this error.  I’ve seen a couple other posts where this can be related to custom Variables, of which I have many.  Just posting the question to see if anyone has any thoughts on how to begin looking with the differences between versions before I go crazy looking at every single Variable in my system.