I have trained YOLOv2 model on my custom dataset(Single class - Battery). Changed filters to 30, classses to 1 and max_batches to 2000 in the cfg file. I get the final weights and when I try to predict in realtime using webcam I am facing the below issue -
Traceback (most recent call last):
File "/home/dinesh/workspace/darknet-master/yolo_obj_detection.py", line 75, in <module>
outs = net.forward(getOutputsNames(net))
cv2.error: OpenCV(4.1.0) /io/opencv/modules/dnn/src/layers/region_layer.cpp:97: error: (-215:Assertion failed) inputs[0][3] == (1 + coords + classes)*anchors in function 'getMemoryShapes'
I'm using
Python - 3.6.7
OpenCV - 4.1.0
With same configuration I have trained the YOLOV3 model and predicted in real-time without any issues but when I use YOLOV2 I'm facing this error. How can I overcome this?