问题
I am working with Keras and happens to me to leave the jupyter notebook running overnight and close the browser. When I reopen it, the notebook gets stuck in the (Starting) phase and while the kernel is still running I cannot see any update in the output cells. Leaving the browser open doesn't help because eventually the output freezes anyway.. I don't know the exact memory taken by the notebook, but it's a con with several layers so I bet quite heavy. I am working on Ubuntu with Firefox. Any help is appreciated, thanks!
回答1:
Had the same issue & here is the workaround that i have found:
Use the callback functionality to log the intermidiate results of the model into a CSV:
from keras.callbacks import CSVLogger
csv_logger = CSVLogger('training.log')
model.fit(X_train, Y_train, callbacks=[csv_logger])
Also, add the %% capture
at the top of the cell where you are calling the fit function, so that no output is not displayed in the Jupyter at all.
来源:https://stackoverflow.com/questions/43133916/jupyter-notebook-output-cell-freezes-keras-related