caffe icon indicating copy to clipboard operation
caffe copied to clipboard

training is freezing for multiple hours

Open ghost opened this issue 12 years ago • 6 comments

I am fine tuning the imagenet pretrained model using around 170k training images. After certain number of iterations of training ( e.g. 1600 - depends on the training set; last week it was getting stuck around iteration 2420 on a different dataset), it seems to freeze for 3/4 ( sometimes more ) hours without showing any diagnostic message for the freeze. Has anyone experienced this / Does anyone have the solution?

ghost avatar Nov 07 '14 02:11 ghost

I'm experiencing the same.

amiralush avatar Nov 09 '14 15:11 amiralush

Even though I could not find the reason, I was able to continue training by resuming from the last snapshot taken. It freezes again after some number (usually pretty high this time) of iterations, though.

ghost avatar Nov 09 '14 16:11 ghost

This also happens to me. It happens for a while now.

I did some investigation into this:

  1. When I let the training continue the computer "defreezes" after some time. Somtimes it takes minutes, but I have seen it to take almost 24 hours. When I let the training continue this freezing happens every few hours.
  2. I replaces the data layer with a dummy data layer and run it again. This time this freezing didn't happen. (I run it for about 24 hours and only once, so it may be a coincidence.)

Currently I assume it has something to do with the lmdb dataset implementation, and am looking into the code. @shelhamer I think a bug should be open for this.

talda avatar Nov 11 '14 13:11 talda

@talda this sounds quite serious. A data pipeline overhaul is on the charts for after the CVPR deadline. In particular, simplifying and verifying the correctness of #1238 is on the list.

Stalling like this was never observed for training the Caffe reference models 100,000s of iterations. An issue was potentially introduced with the merge of #1238 or other data refactoring. You could try your training by running a version before #1238 to help diagnose the problem.

shelhamer avatar Nov 11 '14 20:11 shelhamer

@shelhamer This problem happened also before #1238 It started to happen to me when I switched from a much older version to fc921bf9d6959f06705b7ea52b2e28733b3fdd42 (and continue to happen after #1238).

talda avatar Nov 13 '14 10:11 talda

If this is the same problem as #1377, try setting /proc/sys/vm/swappiness to zero. This solved our system freezes. See this very helpful answer from the main author of LMDB, http://www.openldap.org/lists/openldap-technical/201503/msg00077.html

There are more possible alternative solutions in #1377 discussion.

brianhwang123 avatar Mar 20 '15 21:03 brianhwang123