Skip to content

Commit

Permalink
Remove thrash and allow to load latest pkl files
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonfaaria committed Aug 7, 2020
1 parent 212ba54 commit 756bae3
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 91 deletions.
26 changes: 0 additions & 26 deletions gen.bat

This file was deleted.

16 changes: 0 additions & 16 deletions play_dlatents.bat

This file was deleted.

16 changes: 0 additions & 16 deletions play_vectors.bat

This file was deleted.

11 changes: 0 additions & 11 deletions prepare_dataset.bat

This file was deleted.

5 changes: 0 additions & 5 deletions project.bat

This file was deleted.

3 changes: 0 additions & 3 deletions reduce_model.bat

This file was deleted.

6 changes: 4 additions & 2 deletions src/training/training_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def training_loop(
network_snapshot_ticks = 50, # How often to save network snapshots? None = only save 'networks-final.pkl'.
save_tf_graph = False, # Include full TensorFlow computation graph in the tfevents file?
save_weight_histograms = False, # Include weight histograms in the tfevents file?
resume_pkl = None, # Network pickle to resume training from, None = train from scratch.
resume_pkl = 'latest', # Network pickle to resume training from, None = train from scratch.
resume_kimg = 0.0, # Assumed training progress at the beginning. Affects reporting and training schedule.
resume_time = 0.0, # Assumed wallclock time at the beginning. Affects reporting.
restore_partial_fn = None, # Filename of network for partial restore
Expand Down Expand Up @@ -162,7 +162,9 @@ def training_loop(
D = tflib.Network('D', num_channels=training_set.shape[0], resolution=resolution, label_size=training_set.label_size, **D_args)
Gs = G.clone('Gs')
if resume_pkl is not None:
if resume_pkl == 'restore_partial':
if resume_pkl == 'latest':
resume_pkl, resume_kimg = misc.locate_latest_pkl(dnnlib.submit_config.run_dir_root)
elif resume_pkl == 'restore_partial':
print(' Restore partially...')
# Initialize networks
G = tflib.Network('G', num_channels=training_set.shape[0], resolution=resolution, label_size=training_set.label_size, **G_args)
Expand Down
6 changes: 0 additions & 6 deletions train.bat

This file was deleted.

6 changes: 0 additions & 6 deletions train_resume.bat

This file was deleted.

0 comments on commit 756bae3

Please sign in to comment.