I successfully trained OpenCV Face detector using Caffe+SSD and our custom dataset as included in this description: opencv/how_to_train_face_detector.txt at master · opencv/opencv · GitHub
The detection works correctly and result are very good. Now I would like to add new detection class into the model. Let’s say “face_with_glasses”.
I added new class into labelmap.prototxt, increased num_classes in prototxt files and added new training samples with annotations. The training process immediately ended with the following error:
Check failed: num_priors_ * num_classes_ == bottom->channels() Number of priors must match number of confidence predictions.
So I modified the prototxt files according to this Parameters to change for training custom data · Issue #7 · chuanqi305/SqueezeNet-SSD · GitHub and now the training process runs as usual and there seems to be no problem.
But the problem appears during the detection in OpenCV (version 4). The detection result is completely scrambled. It returns many totally wrong rectangles (where many of them are out of image bounds) with confidence 1.0.
What could be the cause of this problem?