Skip to content

Question about training with own data #81

@ghZHM

Description

@ghZHM

I follow the instructions to install the model. And I train the model in voc2007 for 30,000 iteration with ' IMS_PER_BATCH: 2', the result seems normal.
mAP: 0.3279 aeroplane : 0.5760 bicycle : 0.5919 bird : 0.2792 boat : 0.1606 bottle : 0.2195 bus : 0.4927 car : 0.7099 cat : 0.0822 chair : 0.1200 cow : 0.3114 diningtable : 0.0533 dog : 0.1096 horse : 0.0607 motorbike : 0.6474 person : 0.3175 pottedplant : 0.2002 sheep : 0.3854 sofa : 0.2155 train : 0.4436 tvmonitor : 0.5824
It did not reach the best point, but at least it proves it can works properly.
But when I use my own data to train the network, the map is 0.0005%.
My dataset has only 2 classes, and about 12000 images in total. One class exist in every image, and this class can not be recognized. The map of this class is 0.
I modify some of the training settings in config file.
ROI_BOX_HEAD: NUM_CLASSES: 3
Since I have only one GPU, I met the OOM problem, and I follow the comment, and change the settings to
SOLVER: IMS_PER_BATCH: 1 BASE_LR: 0.0025 WEIGHT_DECAY: 0.0001 WARMUP_ITERS: 200 STEPS: (0, 30000, 40000) MAX_ITER: 60000 CHECKPOINT_PERIOD: 1000
I change the "CLASSES" in datasets/voc.py to the classes of my dataset as following CLASSES = ( "__background__ ", "trafficePolice", "pedestrian", )
The spelling is copied from annotation file.
And I remove the lower() in name = obj.find("name").text.lower().strip() in lines136 of voc.py because the unrecognized class has a upper class letter.
Except I point out the location of regions proposal and dataset, I do not make any other changes on the code.
This overall training process seems to be normal.
The data was feed into model, and the trend of loss keeps decreasing and every element of loss has value.
Could you give me some advice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions