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

Quality-of-Life for Google Colab #3

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Prev Previous commit
Next Next commit
Resume from the latest pickle
woctezuma committed Jan 10, 2024
commit 61bc29cc3a2b6aa02d0afe224d2dd85329a9dcea
5 changes: 5 additions & 0 deletions training/training_loop.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@

import legacy
from metrics import metric_main
from training import misc as tmisc

#----------------------------------------------------------------------------

@@ -152,6 +153,10 @@ def training_loop(
G_ema = copy.deepcopy(G).eval()

# Resume from existing pickle.
if resume_pkl == 'latest':
out_dir = tmisc.get_parent_dir(run_dir)
resume_pkl = tmisc.locate_latest_pkl(out_dir)

if (resume_pkl is not None) and (rank == 0):
print(f'Resuming from "{resume_pkl}"')
with dnnlib.util.open_url(resume_pkl) as f: