ziqi-jin / finetune-anything

Fine-tune SAM (Segment Anything Model) for computer vision tasks such as semantic segmentation, matting, detection ... in specific scenarios
MIT License
790 stars 56 forks source link

Problems with lr scheduler #57

Open xdedss opened 10 months ago

xdedss commented 10 months ago

https://github.com/ziqi-jin/finetune-anything/blob/1e5640d7796b078248b1c24a18ca34c6d834f025/extend_sam/__init__.py#L34C5-L34C18

The default args are not passed into get_scheduler in train.py

        max_epoch=1,
        n_epochs_init=50,
        n_epochs_decay=50,

As a result, cosine and linear scheduler does not work properly. cosine will oscillate rapidly between 1 and 0 and linear will decrease the lr to negative values, causing the loss to explode

yjdzyr commented 8 months ago

Have you solved this problem? I have the same problem

xdedss commented 7 months ago

Have you solved this problem? I have the same problem

a temporary fix is to remove this line and add your own lr scheduler