Skip to content

Commit

Permalink
set strict=false to avoid incompatible keys error during matching of …
Browse files Browse the repository at this point in the history
…head layers
  • Loading branch information
arunppsg committed Dec 7, 2023
1 parent 1e47ffd commit 3ddf373
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepchem/models/torch_models/modular.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ def load_from_pretrained( # type: ignore
if source_model is not None:
for name, module in source_model.components.items():
if components is None or name in components:
self.components[name].load_state_dict(module.state_dict())
self.components[name].load_state_dict(module.state_dict(),
strict=False)
self.build_model()

elif source_model is None:
Expand Down

0 comments on commit 3ddf373

Please sign in to comment.