简体   繁体   English

如果我执行一个以上的纪元,为什么我的keras模型会终止并冻结我的笔记本?

[英]Why does my keras model terminate and freeze my notebook if I do more than one epoch?

I did 1 nb_epoch with batch sizes of 10 and it successfully completed. 我做了1个nb_epoch ,批处理大小为10,它成功完成了。 The accuracy rate was absolutely horrible coming in at a whopping 27%. 准确率绝对惊人,高达27%。 I want to make it run on more than one epoch to see if the accuracy will, ideally, be above 80% or so, but it keeps freezing my Jupyter Notebook if I try to make it do more than one epoch. 我想让它运行超过一个纪元,以查看精度是否理想地达到80%左右,但是如果我尝试使其不止一个纪元,它会使我的Jupyter Notebook保持冻结。 How can I fix this? 我怎样才能解决这个问题?

My backend is Theano just for clarification. 我的后端是Theano,仅供说明。

There is definitely a correlation between performance and batch_size. 性能和batch_size之间肯定存在关联。 I tried doing batch_size=1 and it took 12s of horrifying, daunting, unforgivable time out of my day to do 1 epoch. 我尝试执行batch_size = 1,花了我12天的恐怖,令人生畏和不可原谅的时间来完成1个纪元。

It takes time to run through the epochs and sometimes it looks like it freezes, but it still runs and if you wait long enough it will finish. 在各个时间段运行需要花费时间,有时看起来好像冻结了,但是它仍然运行,并且如果您等待足够长的时间,它将完成。 Increasing the batch size makes it run through the epochs faster. 批处理大小的增加使其更快地运行。

You probably have to look into more factors. 您可能需要研究更多因素。 Look at the system resources, eg CPU, Memory, Disk IO. 查看系统资源,例如CPU,内存,磁盘IO。 (If you use linux, run sar command) (如果使用Linux,请运行sar命令)

For me, I had other problem with frozen notebook, and it turns out to be the issue of low memory. 对我来说,冻结笔记本还有其他问题,事实证明这是内存不足的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM