Replies: 3 comments 4 replies
-
Hi did you get it to work? Trying to do the same |
Beta Was this translation helpful? Give feedback.
-
Hi here,
from detectron2.engine import DefaultTrainer cfg = get_cfg() cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "model_final.pth") # path to the model we just trained Now I have another dataset with 5000 images on chairs. I don't want to re-register and re-train my model for 2 categories from scratch. I want to use the concept of transfer learning here. Please someone guide me by giving me sample code snippet by highlighting what to change and where to change in my code for the same. It'll be really grateful of you if someone could reply on this asap. I'm working on a live project and it has a deadline for the same. |
Beta Was this translation helpful? Give feedback.
-
It seems that we can set the following to freeze the weights of earlier layers? Hope someone more experienced can verify. Thank you: cfg = get_cfg() to freeze the backbone and proposal_generator layers: freeze = ['backbone', 'proposal_generator'] trainer.resume_or_load(resume=False) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi together,
first thank you for sharing this amazing project.
Now I would like to ask, is there a way in detectron2 to freeze certain parts of a model or should the PyTorch API be used, like:
Is there an efficient way to freeze the whole model except the
roi_heads
as they cannot be loaded due to different number of classes?I have also noticed, that some layers are "frozen" per default for the specified baseline
Should these layers always remain frozen, even in the case of fine-tuning (Phase II)?
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions