Training hangs and overfitting

Hi,
randomly my training hangs, I would say that the program doesn’t advance anymore. Is it the GPU that overheat ?
Second question : how to avoid overfitting with this program ?
This is the program : Dropbox - train.py - Simplify your life
Thank you
Best regards