How can I train dlib shape predictor using a very large training set

落花浮王杯 提交于 2020-01-06 06:18:37

问题


I'm trying to use the python dlib.train_shape_predictor function to train using a very large set of images (~50,000).

I've created an xml file containing the necessary data, but it seems like train_shape_predictor loads all the referenced images into RAM before it starts training. This leads to the process getting terminated because it uses over 100gb of RAM. Even trimming down the data set uses over 20gb (machine only has 16gb physical memory).

Is there some way to get train_shape_predictor to load images on demand, instead of all at once?

I'm using python 3.7.2 and dlib 19.16.0 installed via pip on macOS.


回答1:


I posted this as an issue on the dlib github and got this response from the author:

It's not reasonable to change the code to cycle back and forth between disk and ram like that. It will make training very slow. You should instead buy more RAM, or use smaller images.

As designed, large training sets need tons of RAM.



来源:https://stackoverflow.com/questions/54155910/how-can-i-train-dlib-shape-predictor-using-a-very-large-training-set

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