Solved by ptrblck in post #8 
              
              
                It sounds rather like a multiprocessing issue (or code parts are executed after the training, which are not shown in the posted code). 
You should be able to export the notebook as a Python script file and run it in a terminal.