Skip to content

Commit df88d1a

Browse files
committed
Use 1-based indexing for epochs
1 parent b036c0b commit df88d1a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

plasma/models/builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ def load_model_weights(self, model, custom_path=None):
312312
epochs = self.get_all_saved_files()
313313
if len(epochs) == 0:
314314
g.write_all('no previous checkpoint found\n')
315-
return -1
315+
# TODO(KGF): port indexing change (from "return -1") to parts
316+
# of the code other than mpi_runner.py
317+
return 0
316318
else:
317319
max_epoch = max(epochs)
318320
g.write_all('loading from epoch {}\n'.format(max_epoch))

plasma/models/mpi_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def mpi_train(conf, shot_list_train, shot_list_validate, loader,
819819
# 2019-11-06 18:27:31.698908: I ... dynamic library libcublas.so.10
820820
# which are NOT suppressed by set_verbosity. See top level __init__.py
821821

822-
# load the latest epoch we did. Returns -1 if none exist yet
822+
# load the latest epoch we did. Returns 0 if none exist yet
823823
e = specific_builder.load_model_weights(train_model)
824824
e_old = e
825825

0 commit comments

Comments
 (0)