rf-detr icon indicating copy to clipboard operation
rf-detr copied to clipboard

"freeze_encoder" does not work correctly

Open AyanamiReiFan opened this issue 2 months ago • 1 comments
trafficstars

Search before asking

  • [x] I have searched the RF-DETR issues and found no similar bug report.

Bug

The params freeze_encoder=True will not work if set it only in model.train(freeze_encoder=True), it must be set in the Class kwargs: RFDETRBase(freeze_encoder=True) . Beacuse the backbone params is set not requrires_grad during the initlization.

Environment

Any Env

Minimal Reproducible Example

from rfdetr import RFDETRBase

model = RFDETRBase( resolution=1024, freeze_encoder=True, )

model.train( dataset_dir='./xxx', num_classes=1, epochs=100, warmup_epochs=3, batch_size=1, grad_accum_steps=8, lr=5e-4, lr_scheduler='cosine', lr_min_factor=0.05, output_dir='./xxx/xxx', resolution=1024, freeze_encoder=True, run_test=False, )

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes, I'd like to help by submitting a PR!

AyanamiReiFan avatar Sep 16 '25 09:09 AyanamiReiFan

we didn't test that argument with this codebase, totally believe there's an issue. lotta little things like that here. feel free to submit a pr, otherwise we'll get to it when we have time

isaacrob-roboflow avatar Sep 16 '25 18:09 isaacrob-roboflow