Skip to content

Commit

Permalink
make sure the meta train loop stops at a step that makes sense
Browse files Browse the repository at this point in the history
  • Loading branch information
Flux9665 committed Apr 10, 2023
1 parent ee33997 commit 5144760
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def train_loop(net,
"""
net = net.to(device)

if steps % steps_per_checkpoint == 0:
steps = steps + 1
else:
steps = steps + ((steps_per_checkpoint + 1) - (steps % steps_per_checkpoint)) # making sure to stop at the closest point that makes sense to the specified stopping point

style_embedding_function = StyleEmbedding().to(device)
check_dict = torch.load(path_to_embed_model, map_location=device)
style_embedding_function.load_state_dict(check_dict["style_emb_func"])
Expand Down

0 comments on commit 5144760

Please sign in to comment.