Yet-Another-EfficientDet-Pytorch icon indicating copy to clipboard operation
Yet-Another-EfficientDet-Pytorch copied to clipboard

Loss not decreasing

Open mnoroozii opened this issue 2 years ago • 11 comments

I have a 40000 images custom dataset consisting 19 classes. I have trained the model d2 from pre-trained. I let it run 10 days and the loss is not decreasing even at epoch 250 and stuck at 4.something from day 1. I should mention that I have froze the backbone.

the code: python train.py -c 2 -p efficientdet --batch_size 8 --lr 1e-3 --load_weights last --head_only True

I have tried not to freeze the backbone but I got memory limit error.

Any suggestion?

mnoroozii avatar Feb 12 '22 17:02 mnoroozii

you should try d0, which is good enough for most tasks. and you should validate on a smaller dataset, like the shape dataset that I provided on releases.

zylo117 avatar Feb 12 '22 17:02 zylo117

I have tried d0 but after the same problem (loss), I thought maybe the problem was about the image size. Therefore I have selected bigger network which was d2. about the size of dataset I have created 2000 images per class with augmentation for better training. That is why the size of dataset is huge.

mnoroozii avatar Feb 12 '22 17:02 mnoroozii

so can you get a reasonable mAP on shape dataset? If you can, then probably it has something to do with your dataset's annotation

zylo117 avatar Feb 12 '22 17:02 zylo117

Yes there is no complaint about shape dataset. So do you think I will get the same result with other efficientdet implementation with this dataset?

mnoroozii avatar Feb 12 '22 17:02 mnoroozii

possibly, if your annotation is correct. you should visualize it and make sure the category id starts from 1 like coco does.

zylo117 avatar Feb 12 '22 18:02 zylo117

image

mnoroozii avatar Feb 12 '22 18:02 mnoroozii

great, can you visualize it on your images?

zylo117 avatar Feb 12 '22 18:02 zylo117

How can I do that with train set? By the way, I have trained this model with ubonto

mnoroozii avatar Feb 12 '22 18:02 mnoroozii

try https://www.robots.ox.ac.uk/~vgg/software/via/via.html

zylo117 avatar Feb 13 '22 15:02 zylo117

I cannot import my annotations in via. But it is correct. Just for double checking this is my json format:

image

which could be different in terms of style with other jsons. does it look appropriate for feeding this efficientdet?

mnoroozii avatar Feb 13 '22 20:02 mnoroozii

via does have troubles loading non-standard coco annotations

zylo117 avatar May 07 '22 13:05 zylo117