Closed YANGYUFEI1234 closed 4 years ago
@YANGYUFEI1234 this is normal behavior. yolov3-spp.cfg (the default) is configured for 80 classes, so you can use it to train datasets with up to 80 classes (labelled with class numbers 0-79).
@YANGYUFEI1234 this is normal behavior. yolov3-spp.cfg (the default) is configured for 80 classes, so you can use it to train datasets with up to 80 classes (labelled with class numbers 0-79).
Thank you for replying so quickly. What should I do if I want to train custom data, I follow the everything in 'train custom data example', It always won't work if I change default cfg file....
@YANGYUFEI1234 this is normal behavior. yolov3-spp.cfg (the default) is configured for 80 classes, so you can use it to train datasets with up to 80 classes (labelled with class numbers 0-79).
My dataset is pretty small, which is only 52 MB, so maybe you can try to reproduce the bug and see what will happen
@YANGYUFEI1234 we don't have time to look at individual user's data, but rest assured the training code is error free if your dataset is configured correctly. See https://docs.ultralytics.com/yolov5/tutorials/train_custom_data for directions on exactly how to format your data and cfg files according to your class count.
Alternatively, if the default cfg is working for you, you can simply use that as well.
@YANGYUFEI1234 also there are several other premade cfg files available in the cfg folder, such as yolov3-spp-1cls.cfg for single class datasets. Lastly, zero mAP after a few epochs doesn't mean anything, you need to train for hundreds of epochs, or thousands possibly, to achieve best results.
@YANGYUFEI1234 also there are several other premade cfg files available in the cfg folder, such as yolov3-spp-1cls.cfg for single class datasets. Lastly, zero mAP after a few epochs doesn't mean anything, you need to train for hundreds of epochs, or thousands possibly, to achieve best results.
ok, thanks
Hi, I am having the same issue, in my case there are 6 classes, so finding a suitable cfg file is a bit problematic. Is there a way to train the network without loading initial weights? I saw some tutorials that add the variable: --weights '' to train.py , but it does not seem to work. If it is not possible, then what are the alternatives?
@Galalon to train with no initial weights use python3 train.py --weights ''
I'll close this issue for now as the original issue appears to have been resolved, and/or no activity has been seen for some time. Feel free to comment if this is not the case.
π Bug
Thank you for sharing your project !!! Training custom data which has two classes, if I don't modify the filtersize and numclasses in '.cfg' file, everything works fine, I can train and detect normally. (Actually I forget to change the 'cfg' file at the beginning) However if I modify the filtersize to 21, which is (3*(5+2)), and numclasses in yolo layer to 2. P, R, mAP are always zero, I don't know whether it is a bug or my fault. I know it seems like I should set default weights to nothing rather than the former default value as training from scratch, but it still doesn't work.
To Reproduce
Steps to reproduce the behavior:
python3 train.py --device 0 --data data/swim.data --cfg cfg/yolov3-spp-swim.cfg
Expected behavior
read 96 images for training and corresponding labels read 10 images for training and corresponding labels And then comes with P, R, mAP are all equals to zero no matter how many epochs
Environment
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.