# Training Face Detection model on custom dataset using caffe

**URL:** <https://forum.opencv.org/t/training-face-detection-model-on-custom-dataset-using-caffe/3002>\
**Category:** Uncategorized\
**Tags:** dnn, face, caffe\
**Created:** [April 27, 2021, 4:19am UTC](https://forum.opencv.org/t/training-face-detection-model-on-custom-dataset-using-caffe/3002 "2021-04-27T04:19:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![astanwar99](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/astanwar99/32/1936_2.png) [@astanwar99](https://forum.opencv.org/u/astanwar99)\
**Post date:** [April 27, 2021, 4:19am UTC](https://forum.opencv.org/t/training-face-detection-model-on-custom-dataset-using-caffe/3002/1 "2021-04-27T04:19:45Z")

</div>

I am following the steps from [https://github.com/opencv/opencv/blob/master/samples/dnn/face\_detector/how\_to\_train\_face\_detector.txt](https://github.com/opencv/opencv/blob/master/samples/dnn/face_detector/how_to_train_face_detector.txt) to train Face detection model on custom dataset.

I am using Ubuntu 20.04 based docker container. I was able to complete all the steps but I am getting in final training step. I am getting this error while doing it:

```
I0427 08:47:07.764628 26 net.cpp:283] Network initialization done.
[libprotobuf ERROR google/protobuf/text_format.cc:307] Error parsing text-format caffe.NetParameter: 1813:9: Message type "caffe.DetectionOutputParameter" has no field named "clip".
F0427 08:47:07.765632 26 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: test.prototxt
***Check failure stack trace:***
    @ 0x7fc08ccf71c3 google::LogMessage::Fail()
    @ 0x7fc08ccfc25b google::LogMessage::SendToLog()
    @ 0x7fc08ccf6ebf google::LogMessage::Flush()
    @ 0x7fc08ccf76ef google::LogMessageFatal::~LogMessageFatal()
    @ 0x7fc08d10751a caffe::ReadNetParamsFromTextFileOrDie()
    @ 0x7fc08cf52ede caffe::Solver<>::InitTestNets()
    @ 0x7fc08cf5501d caffe::Solver<>::Init()
    @ 0x7fc08cf5528e caffe::Solver<>::Solver()
    @ 0x7fc08d175a88 caffe::Creator_SGDSolver<>()
    @ 0x55c12a8bfee0 caffe::SolverRegistry<>::CreateSolver()
    @ 0x55c12a8b9098 train()
    @ 0x55c12a8b5c2c main
    @ 0x7fc08c0670b3 __libc_start_main
    @ 0x55c12a8b662e _start
root@42e16ec93639:/home/caffe/FaceDetection# 

```

I found this [https://github.com/opencv/opencv/pull/14938](https://github.com/opencv/opencv/pull/14938) in opencv but I am not sure what to do. Any help is appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [April 27, 2021, 8:59am UTC](https://forum.opencv.org/t/training-face-detection-model-on-custom-dataset-using-caffe/3002/2 "2021-04-27T08:59:20Z")

</div>

opencv version ? do you use your own protobuf or the 3rdparty one ?

neither ` net.cpp` nor `upgrade_proto.cpp` are part of opencv,  
so where does it come from ?
