0

I am trying train dlib's shape_predictor for 194 landmarks with halen dataset

but it gives bad allocation exception when I run it command prompt

D:\Facial Feature Extraction>train_shape_predictor_ex.exe face_detector
Program is started
exception thrown!
bad allocation

, I reduced the number of image to only 50 then it run successfully but the result is not satisfactory. So I tried to train with 64 GB RAM System but bow I increased the parameter

trainer.set_nu(0.05);
trainer.set_tree_depth(2);

but now it is still showing bad allocation error. If I train with less data and for smaller parameter the train model is not correct.

Community
  • 1
  • 1
NAYA
  • 45
  • 1
  • 1
  • 6
  • Yes, Dlib's shape predictor takes a lot of RAM and CPU time (one core) for training. trainer.set_tree_depth(2); - this param increases RAM requirement exponentional, num_cascades and some other - linear. Can you tell me all your training params, amount of images and how many RAM does it takes when it does not have an error? – Evgeniy May 22 '16 at 08:36
  • @Evgeniy When there is no error: `1,934 GB` RAM, and number of images-372 as training samples and 52 as testing samples. Parameters values is same as given in [link](http://dlib.net/train_shape_predictor_ex.cpp.html) – NAYA May 22 '16 at 08:55
  • are you sore that your code is 64 bit? – Evgeniy May 22 '16 at 09:07
  • @Evgeniy Are you asking about operating system? – NAYA May 22 '16 at 09:15
  • @Evgeniy No My code is 32 bit (it showed in task Manager) – NAYA May 22 '16 at 09:29
  • so, this is the reason. recompile to 64 bit and it should work – Evgeniy May 22 '16 at 09:43

1 Answers1

0

Build your application in Release Mode and target to 64-bit Windows plateform.

  • Also Enable \LARGEADDRESSAWARE Flag in your Project.

Here is a link to your question: Answer

Community
  • 1
  • 1