Recently, I use pytorch to generate some adversarial samples, and the algothim is FGSM. Just like
https://pytorch.org/tutorials/beginner/fgsm_tutorial.html 3 . It was very smooth at the beginning of mu program. But soon pytorch told me that cuda is out of memory. I guess there will be a part of the GPU memory has not been released. And I know torch.cuda.empty_cache(）but it didn’t work. So how could I resolve this problems? Thanks for anyone who could help me!