Open AhaEdgar opened 6 years ago
Yes Loss, IOU, Recall look good but why Class is less than 1? What does cfg's [region] look like?
[region]
anchors = 1.3221, 1.73145, 3.19275, 4.00944, 5.05587, 8.09892, 9.47112, 4.84053, 11.2364, 10.0071
bias_match=1
classes=6
coords=4
num=5 #5
softmax=1
jitter=.3
rescore=1
object_scale=5
noobject_scale=1
class_scale=1
coord_scale=1
absolute=1
thresh = .6
random=0 #1
I use the input size 608 * 608 and modify the network structure @patrick-ucr
2 things observed. Are you training VOC datasets? Because anchors look different from the default values for VOC. Second, your datasets might be too small because the network should have seen 6 classes not 0.9xxx like the log shows. This may explain why you have good results. Check your training sets that should be large enough and share some characteristics with the test sets.
thanks for your advice. my dataset has 3000 images for training,most of training images has only one class. I don't understand the meaning of “Class:0.9xxx” ,I had thought it means good results close to1. can u tell me more about the “Class:6.0000”or“Class:0.9”? @patrick-ucr
@Ahagpp I am not sure about that but I am training a network to detect "one" class of objects and my class numbers are always "1.000000". I suggest you check annotation+datasets, make sure that classes are numbers 0-5 according to your .names file.
I modify my data/voc.names for training. the file like this
bus
microbus
minivan
sedan
suv
truck
I have checked the labels/xxxx.txt , the 0-5 number is right @patrick-ucr
your voc.names looks good but you have to check annotation txt files in VOCdevkit/VOC2007/labels/ and make sure that they have in each line like this sample
0 0.516417910448 0.501 0.202985074627 0.202
where the first number should be 0-5 which represents your object classes in voc.names. For example, 0 means bus, 1 means microbus, and on and on. Hope this helps.
I have checked the files what you said. txt files seem to have no problem. did u modify example/yolo.c this file?
#include "darknet.h"
char *voc_names[] = {"aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};
void train_yolo(char *cfgfile, char *weightfile)
{
char *train_images = "/data/voc/train.txt";
char *backup_directory = "/home/pjreddie/backup/";
srand(time(0));
char *base = basecfg(cfgfile);
printf("%s\n", base);
float avg_loss = -1;
network *net = load_network(cfgfile, weightfile, 0);
printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net->learning_rate, net->momentum, net->decay);
int imgs = net->batch*net->subdivisions;
int i = *net->seen/imgs;
data train, buffer;
layer l = net->layers[net->n - 1];
int side = l.side;
int classes = l.classes;
float jitter = l.jitter;
list *plist = get_paths(train_images);
//int N = plist->size;
char **paths = (char **)list_to_array(plist);
.....
.....
I didn't modify this file, maybe this is the reason?@patrick-ucr
That is the problem, you should change voc_names[] according to your own dataset. There are several places also need changes, it's easy to find out how and where in other issues.
Why my result is Region Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: 0.003070, .5R: -nan, .75R: -nan, count: 0
what wrong? any body can help me
I think you should post a new issue or find an existing one for that problem, but I already had this problem, perhaps you forgot something in the yolo.cfg file but it's hard to say because you gave no information (give the train command and other things like classes, num of images etc).
quite a late response :o lol
the test result is 8% every class .....T T