Skip to content

Commit

Permalink
Update start.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoadesScholar authored Mar 20, 2024
1 parent c128020 commit 8bb5d50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dacapo/experiments/starts/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def _set_weights(model, weights, run, criterion, old_head=None, new_head=None):
head_weights[key] = weights.model[key]
for key in head_keys:
weights.model.pop(key, None)
model.load_state_dict(weights.model, strict=False)
try:
model.load_state_dict(weights.model, strict=True)
except:
logger.warning("Unable to load model in strict mode. Loading flexibly.")
model.load_state_dict(weights.model, strict=False)
model = match_heads(model, head_weights, old_head, new_head)
except RuntimeError as e:
logger.error(f"ERROR starter matching head: {e}")
Expand Down

0 comments on commit 8bb5d50

Please sign in to comment.