Open omarmaree opened 4 years ago
So what is the problem?
Divide the dataset into 5 parts, combine 1-4 parts to train.txt and 5th part to valid.txt and set in obj.data train = train.txt valid = valid.txt
And train Detector with -map flag and Classifier with -topk flag at the end of training command.
So what is the problem?
Divide the dataset into 5 parts, combine 1-4 parts to train.txt and 5th part to valid.txt and set in obj.data train = train.txt valid = valid.txt
And train Detector with -map flag and Classifier with -topk flag at the end of training command.
so the training comand will be like this? "darknet.exe detector train data/obj.data yolo-obj.cfg darknet53.conv.74 -map -topk " without specify the number of folds and there is no modification in the codes?
If you train Detector then:
And train Detector with -map flag and Classifier with -topk flag at the end of training command.
so the training comand will be like this "darknet.exe detector train data/obj.data yolo-obj.cfg darknet53.conv.74 -map "
Cross-validation 5 folds
You should:
mAP_cross_val = (mAP1 + mAP2 + ... + mAP5) / 5
If you train Detector then:
And train Detector with -map flag and Classifier with -topk flag at the end of training command.
so the training comand will be like this "darknet.exe detector train data/obj.data yolo-obj.cfg darknet53.conv.74 -map "
Cross-validation 5 folds
You should:
- create 5 files train1.txt - train5.txt
- create 5 files valid1.txt-valid5.txt
- create 5 obj.data with train=train1.txt valid=valid1.txt
- And train 5 times with different obj1 ... obj5.data files "darknet.exe detector train data/obj1.data yolo-obj.cfg darknet53.conv.74 -map" ... then average the final values mAP
mAP_cross_val = (mAP1 + mAP2 + ... + mAP5) / 5
but the final weights will be for the last trained model! is that right? or i should use the last best weights for the next training ?
but the final weights will be for the last trained model! is that right?
You can use the best weights-file to check the mAP.
or i should use the last best weights for the next training ?
No. You should train from scratch, by using http://pjreddie.com/media/files/darknet53.conv.74
but the final weights will be for the last trained model! is that right?
You can use the best weights-file to check the mAP. yeah. but as i understand from you to do cross-validation with 5 folds I need to repeat the training 5 times with the different composite of data sets. and after each training, I will have weights of that training. and since each training is not affected by the previous training weights, how the validation will affect on the next training? Also, which weights file should i choose when implementing the trained model?
or i should use the last best weights for the next training ?
No. You should train from scratch, by using http://pjreddie.com/media/files/darknet53.conv.74
and since each training is not affected by the previous training weights, how the validation will affect on the next training?
It will not affect. This is the essence of cross validation.
Also, which weights file should i choose when implementing the trained model?
What does it mean "implementing the trained model" ?
and since each training is not affected by the previous training weights, how the validation will affect on the next training?
It will not affect. This is the essence of cross validation.
Also, which weights file should i choose when implementing the trained model?
What does it mean "implementing the trained model" ? when i using the trained model in my application, which weights file should i use from all training trials?!
You can use any of these 5 weights-file. Or you can train another one weights-file by using the whole dataset (all 5 parts) - preferably (unless the customer explicitly sets other restrictions).
You can use any of these 5 weights-file. Or you can train another one weights-file by using the whole dataset (all 5 parts) - preferably (unless the customer explicitly sets other restrictions).
ok thanks a lot
Hello @AlexeyAB , I trained my model but I got an overfitting problem and i want to solve it by doing cross-validation with 5 folds. can u help me please to do that?