automl icon indicating copy to clipboard operation
automl copied to clipboard

mAP is too low during training Efficientdet on custom dataset

Open horangjang77 opened this issue 2 years ago • 2 comments

Now I'm training Efficientdet model on my custom dataset, but mAP is too low.

I use rtx 3090 tf-nightly=2.8 cudatoolkit=11.2 cuDNN=8.2

And here is my configs image_size: 768x768 num_classes: 35 label_map: {1: none_of_the_above, 2: Vehicle_Car, 3: Vehicle_Bus, 4: Vehicle_Motorcycle, 5: Vehicle_Unknown, 6: Pedestrian_Pedestrian, 7: Pedestrian_Bicycle, 8: Lane_White_Dash, 9: Lane_White_Solid, 10: Lane_Yellow_Dash, 11: Lane_Yellow_Solid, 12: Lane_Blue_Dash, 13: Lane_Blue_Solid, 14: TrafficLight_Red, 15: TrafficLight_Yellow, 16: TrafficLight_Green, 17: TrafficLight_Arrow, 18: TrafficLight_RedArrow, 19: TrafficLight_YellowArrow, 20: TrafficLight_GreenArrow, 21: TrafficSign_Speed, 22: TrafficSign_Else, 23: RoadMark_StopLine, 24: RoadMark_Crosswalk, 25: RoadMark_Number, 26: RoadMark_Character, 27: RoadMarkArrow_Straight, 28: RoadMarkArrow_Straight, 29: RoadMarkArrow_Right, 30: RoadMarkArrow_StraightLeft, 31: RoadMarkArrow_StraightRight, 32: RoadMarkArrow_Uturn, 33: RoadMarkArrow_Else, 34: FreeSpace} clip_gradients_norm: 5.0 jitter_min: 0.8 jitter_max: 1.2 autoaugment_policy: v0

and hyperparameters os.system('python main.py --mode=train_and_eval
--train_file_pattern={TRAIN_SET}
--val_file_pattern={VAL_SET}
--model_name={MODEL}
--model_dir={MODEL_DIR_TMP}
--ckpt={MODEL}
--save_checkpoints_steps=100 --iterations_per_loop=100
--train_batch_size=4 --eval_batch_size=4 --eval_samples=100
--num_examples_per_epoch=500 --num_epochs=30
--hparams={CONFIG_FILE}'.format(TRAIN_SET=TRAIN_SET, VAL_SET=VAL_SET, MODEL=MODEL, CONFIG_FILE=CONFIG_FILE, MODEL_DIR_TMP = MODEL_DIR_TMP) )

Finally this is my eval result Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.052 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.078 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.057 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.027 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.086 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.089 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.002 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.026 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.076 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.030 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.128 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.127 INFO:tensorflow:Inference Time : 10.86932s

If you have any advice, pls help me.

horangjang77 avatar Nov 02 '21 12:11 horangjang77

Training longer and specificing --val_json_file. Don't forget to change aspect_ratios if necessary https://github.com/google/automl/issues/412.

fsx950223 avatar Nov 02 '21 12:11 fsx950223

why do we need to specify --val_json_file? in the code it creates these contents based on the validation tf records used as input? is there something unique that happens if you specify --val_json_file?

ece85 avatar Jun 03 '22 15:06 ece85