Jupyter notebook output cell freezes (Keras related?)

北战南征 提交于 2020-05-30 09:49:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!