RuntimeError: CUDNN_STATUS_INTERNAL_ERROR when l run the program for a second time

I’ve ran into the same problem today, and found my GPU didn’t free it’s memory.
Try this, it works fine for me.
https://discuss.pytorch.org/t/gpu-memory-not-returned/1311