MaixPy_YoloV2
MaixPy_YoloV2 copied to clipboard
Have you ever use this code to train a 2-classes detection model with accuracy printed?
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 } }
The detection results look good although the printed training accuracy is low
No, I will try and let you know.
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