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 concurrent LRFinder instances overwriting each other by using tempfile #3528

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

warner-benjamin
Copy link
Collaborator

Resolves #3415 and resolves #3240 by saving model to TemporaryDirectory under learner path/model_dir.

Tested on Linux and Windows.

If preferred, I can update the PR to use TemporaryDirectory as a context manager in lr_find and pass the temp_dir name to LRFinder.

Notes:

path = self.path/self.model_dir
path.mkdir(parents=True, exist_ok=True)

is required as path/model_dir might not exist yet. And

self.tmp_p = Path(self.tmp_d.name).stem

exists because self.tmp_d.name returns model_dir/tempfolder.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jph00 jph00 merged commit 351f4b9 into fastai:master Nov 29, 2021
@jph00
Copy link
Member

jph00 commented Nov 29, 2021

Many thanks!

@jph00 jph00 added the bug label Nov 29, 2021
@warner-benjamin warner-benjamin deleted the lrfinder_overwrite_fix branch November 29, 2021 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants