sxhxliang / detectron2_backbone

detectron2 backbone: resnet18, efficientnet, hrnet, mobilenet v2, resnest, bifpn
209 stars 40 forks source link

Is this repo really needed for RESNET18 ? #17

Open ExtReMLapin opened 2 years ago

ExtReMLapin commented 2 years ago

Hello,

I recently started using detectron2, if i want to train a custom dataset on resnet18, don't I just need to take RESNET50 model, set DEPTH to 18 and set RES2_OUT_CHANNELS to 64 ?

This way :

        data["MODEL"]["RESNETS"]["DEPTH"] = 18
        data["MODEL"]["RESNETS"]["RES2_OUT_CHANNELS"] = 64

And obviously, without any trained model to import weights from, set weights to "" and unfreeze first two layers

        cfg.MODEL.WEIGHTS = ""
        cfg.MODEL.BACKBONE.FREEZE_AT = 0

As only for RESNET18, what does this repository brings compared to what I just showed above ?

Apologies if it's a naive question, I'm new to this whole deeplearning stuff.

Thanks

Huxwell commented 1 year ago

I know a long time has passed, but I was able to use resnet18/34 successfully with your approach, in fact thanks for the idea! That gives me some speedup, maybe x1.3-1.5. Although it has to be trained from scratch, because I didn't find any compatible COCO pretrained weights online. Also, the DefaultPredictor should be avoided when running inference with your approach.

ExtReMLapin commented 1 year ago

Dang yeah mate, it's been some time