mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 17:56:07 +00:00
Warn when encountering from-scratch-training
This commit is contained in:
@@ -167,6 +167,18 @@ def wrap_policy_in_peft_model(cfg, policy):
|
|||||||
for p in policy.parameters():
|
for p in policy.parameters():
|
||||||
p.requires_grad_(False)
|
p.requires_grad_(False)
|
||||||
|
|
||||||
|
if not cfg.policy.pretrained_path:
|
||||||
|
logging.warning(
|
||||||
|
"Training from scratch using PEFT. This is unlikely to yield good results. "
|
||||||
|
"Consider supplying a `policy.path` to fine-tune an existing model."
|
||||||
|
)
|
||||||
|
|
||||||
|
if cfg.policy.type == "smolvla" and not cfg.load_vlm_weights:
|
||||||
|
logging.warning(
|
||||||
|
"Traning SmolVLA from scratch using PEFT. This is unlikely to yield good results. Set "
|
||||||
|
"`load_vlm_weights=True` to fine-tune the existing policy."
|
||||||
|
)
|
||||||
|
|
||||||
peft_config_policy = get_default_peft_configuration(cfg.policy.type)
|
peft_config_policy = get_default_peft_configuration(cfg.policy.type)
|
||||||
peft_config_cli = dataclasses.asdict(cfg.peft) if cfg.peft else {}
|
peft_config_cli = dataclasses.asdict(cfg.peft) if cfg.peft else {}
|
||||||
peft_config_cli["modules_to_save"] = peft_config_cli["full_training_modules"] # compatibility with PEFT
|
peft_config_cli["modules_to_save"] = peft_config_cli["full_training_modules"] # compatibility with PEFT
|
||||||
|
|||||||
Reference in New Issue
Block a user