Open PimwipaV opened 5 years ago
@Pimpwhippa Hi,
Rename your cfg-file to txt file and attach it to your message.
Your code is asserted at this line - it means that some of parameters doesn't have value (or doesn't have =
): https://github.com/opencv/opencv/blob/3.4/modules/dnn/src/darknet/darknet_io.cpp#L507
CV_Assert(separator_index < line.size());
2. the number of class in the yolo layers to be 1 as I train only 1 additional class.
Do you train 1 additional or only 1 class?
Can you use your cfg-file & trained weights-file successfully with Darknet?
@AlexeyAB
Thank you for your prompt reply. Really appreciated.
I've attached my cfg file in txt format below. some parameters doesn't have value, or equal sign? I checked and checked but I don't see anywhere. The error comes from this line of code: net = cv2.dnn.readNet(args.weights,args.config) Could it be anything to do with the path of the args.weights and args.config files as well?
Since you asked, I think I train only 1 class. Do I understand it correctly? I thought by using the pre-trained weight it means training 1 additional class.
Actually my goal is to train 1 additional class. Later, I also want to be able to choose let's say 20 classes out of 9000 classes. That's still a long way to go, or is it possible at all?
When I do detector test with my cfg and new weights file, it says predicted in 0.xxxxxx seconds, but it doesn't say the class (yet I guess, my dataset is too small). I tried also with the original yolo9000. The class I want (snake) is on the combine9k.names. However, it never predicts any snake for me, but it did predict elephants. Did it happen to you like that too? How do I make sure it says the class?
ps. I like your coaching style, the way you ask people back some (sometimes tricky) questions ;)
@Pimpwhippa
You should comment #
or remove this line
Testing
in your cfg-file.
OpenCV-dnn module supports only Yolo v2 and Yolo v3, but OpenCV-dnn doesn't support Yolo9000. There are pre-trained weights that can be used with OpenCV-dnn module: https://github.com/AlexeyAB/darknet#pre-trained-models
yolov2-voc.weights (20 classes) https://github.com/AlexeyAB/darknet/blob/master/data/voc.names
yolov3.weights (80 classes) https://github.com/AlexeyAB/darknet/blob/master/data/coco.names
yolov3-openimages.weights (601 classes) https://github.com/AlexeyAB/darknet/blob/master/data/openimages.names
If you train with one class - then it will detect only this one class.
@AlexeyAB Thank you! just a #..facepalm myself.. and thank you for the weights files. I meant if I want to choose only the 20 classes that I want, how can I do that?
Dear AlexeyAB,
I follow this tutorial to train one additional class using yolov3 tiny. From the original yolov3-tiny.cfg, I only changed
When I run the script to build the detector, using the revised .cfg file and the newly generated weights file, I get this error cv2.error: OpenCV(3.4.4) /darknet/opencv/opencv-3.4.4/modules/dnn/src/darknet/darknet_io.cpp:507: error: (-215:Assertion failed) separator_index < line.size() in function 'ReadDarknetFromCfgStream'
I tried looking at the code and have no idea what can I do to solve the issue. I think it must be some value in the config file. I googled around, looked at opencv forum but couldn't find much on this particular error. Please could you shed some light.
Thank you so much!