pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.74k stars 21.33k forks source link

I'm trying to train a classifier model using darknet, can I use any cfg file in the darknet/cfg folder? #1208

Open muyue1238 opened 5 years ago

muyue1238 commented 5 years ago

I'm trying to train a classifier model using darknet, and I followed this tutorial, and my training command is like this: ./darknet classifier train cfg/my_classifier.data cfg/darknet19.cfg the 'my_classifier.data' file has been modified according to my dataset. Anyhow, I'm a little confused about the darknet19.cfg. My question is that there are dozen of cfg files the darknet/cfg folder, can I just choose one cfg file and use it to train a classifier model, or I can just use certain cfg file to train it? As far as I know, the darknet19_448.cfg can be used during detector-training process, and it seems there's no big difference between darknet19.cfg and darknet19_448.cfg. Could someone please explain for me. FYI, I've trained my classifier model for about 10000 times, and it worked out not very well, it may be my dataset's problem, but I want to be sure, that's why I want to know if I can use another cfg file to achieve better accuracy.

MMaxV commented 5 years ago

This file, actually, is a description of the model that you are using. It contains all the layers with it's parameters. In order to your dataset you should change these parameters(for example yolov3.cfg):
Line 3: set batch=24, this means we will be using 24 images for every training step Line 4: set subdivisions=8, the batch will be divided by 8 to decrease GPU VRAM requirements. Line 603: set filters=(classes + 5)3 in our case filters=21 Line 610: set classes=2, the number of categories we want to detect Line 689: set filters=(classes + 5)3 in our case filters=21 Line 696: set classes=2, the number of categories we want to detect Line 776: set filters=(classes + 5)*3 in our case filters=21 Line 783: set classes=2, the number of categories we want to detect. (classes are different objects in your dataset, for example cats, dogs, ...) It can be differ in other cfg files. You can use any of cfg files, but you need to change those parameters. Also remember to change your .name and .data files.

han-so1omon commented 5 years ago

Just trying simple detect action following MMaxV's suggestions. Getting Segmentation fault (core dumped). Also using 2 classes.

YunYang1994 commented 5 years ago

https://github.com/YunYang1994/tensorflow-yolov3 hope it helps you

FranciscoReveriano commented 4 years ago

Does anyone have any advice to convert the weights pre-trained in YOLOv3 into classification weights? Basically no YOLO just classification?

water5tyle commented 4 years ago

@FranciscoReveriano, you should use darknet53 model. It's classifier that is used in yolov3.

zaimpower commented 3 years ago

@FranciscoReveriano, you should use darknet53 model. It's classifier that is used in yolov3.

Hi can you briefly explain that because I am working on only classifier not YOLOv3

water5tyle commented 3 years ago

@zaimpower You can read about this on original repo (https://pjreddie.com/darknet/imagenet/)

zaimpower commented 3 years ago

@zaimpower You can read about this on original repo (https://pjreddie.com/darknet/imagenet/)

Yes i have try using it, but that only uses one image. How about my own custom dataset. Will you help :(

water5tyle commented 3 years ago

@zaimpower you can find classification examples on python here https://github.com/AlexeyAB/darknet