Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serialization for saving train checkpoints #271

Merged
merged 1 commit into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions farm/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from tqdm import tqdm
import numpy
import shutil
import dill

from farm.utils import MLFlowLogger as MlLogger
from farm.utils import GracefulKiller
Expand Down Expand Up @@ -460,6 +461,7 @@ def _save(self):
"cuda_rng_state": torch.cuda.get_rng_state(),
},
checkpoint_path / "trainer",
pickle_module=dill,
)

checkpoint_name = f"epoch_{self.from_epoch}_step_{self.from_step}"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ flask-restplus
flask-cors
# optional: for inference with fasttext
#fasttext==0.9.1
dill # pickle extension for (de-)serialization