acGAN - CUDA out of memory

Hello!

I am trying to run the following code: https://github.com/Sirius79/acGAN/blob/master/train.py for more epochs and I get CUDA out of memory error after around 60.

I am a really noob in Torch and I did not write that code. After researching a bit I think some tensors are not allocated the way they should be so the memory usage increases with each iteration, but I cannot find the problem myself (tried, but it takes 3 hours to get to the error so changing every line of code in every possible way does not work).

Any help would be greatly appreciated.

Thanks