The line
total_loss += alpha_loss

adds alpha_loss with its entire computation graph to total_loss. Try this instead.
total_loss += alpha_loss.data[0]

However total_loss is reset to 0 every print_freq batches which will free up the alpha_loss computation graphs that were attached to it, so that probably isn’t the reason why one epoch succeeds and the second fails.
I don’t see where you set best_prec1, but I’m guessing it carries around a computation graph too.