Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Models loaded using the from_archive method need to be saved with original config #5211

Open
AkshitaB opened this issue May 18, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@AkshitaB
Copy link
Contributor

When allennlp train is used to fine-tune a pretrained model (model A) using from_archive(path_to_A), the finetuned model (model B) is saved with the config that contains from_archive. This means that if you try to now finetune the model B, it needs the original model A at the exact path_to_A, as well as model B. In the normal usecase, this will fail if the user does not have access to the original model A. On beaker, depending on how the code is setup, if the path to the pretrained model remains the same in experiment A -> B and experiment B -> C, it will cause a maximum recursion depth error.

Potential solution is to store the original configuration when saving a fine-tuned model (i.e., the from_archive case).

@AkshitaB AkshitaB added the bug label May 18, 2021
@AkshitaB AkshitaB added this to the 2.6 milestone May 18, 2021
@dirkgr
Copy link
Member

dirkgr commented May 27, 2021

We need a Model.to_params API.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants