Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have you ever use this code to train a 2-classes detection model with accuracy printed? #2

Open
shupinghu opened this issue Apr 13, 2020 · 3 comments

Comments

@shupinghu
Copy link

I have used this code to train a 2-classes detection model with accuracy printed using "model.compile(loss=loss_func, optimizer=optimizer, metrics=['accuracy'])" in fit.py. As the training epoch increases, the trainging loss is decreases as well, but the strange thing is that the trainging accuracy is maintained at around 0.14 or even decrease, do you know what happened?

The following are the config.json I have used:
{
"model" : {
"architecture": "MobileNet",
"input_size": 224,
"anchors": [0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828],
"labels": ["kind1", "kind2"],
"coord_scale" : 1.0,
"class_scale" : 1.0,
"object_scale" : 5.0,
"no_object_scale" : 1.0
},
"pretrained" : {
"full": ""
},
"train" : {
"actual_epoch": 60,
"train_image_folder": "datasets/kinds/images",
"train_annot_folder": "datasets/kinds/xmls",
"train_times": 5,
"valid_image_folder": "datasets/kinds/images_valid",
"valid_annot_folder": "datasets/kinds/xmls_valid",
"valid_times": 2,
"batch_size": 32,
"learning_rate": 5e-4,
"saved_folder": "kinds",
"first_trainable_layer": "",
"jitter": true,
"is_only_detect" : false
}
}

@shupinghu
Copy link
Author

The detection results look good although the printed training accuracy is low

@lemariva
Copy link
Owner

No, I will try and let you know.

@easy-and-simple
Copy link

training accuracy is low because loss_class part of loss function always returns 0 and therefore class that have higher importance 5x is not impacting training at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants