-
Notifications
You must be signed in to change notification settings - Fork 304
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
Saving/restoring latent #86
base: main
Are you sure you want to change the base?
Conversation
it works by dumping/restoring the whole EMA and ADAM optimiser objects exemple of how to restore : model = Imagine( text = TEXT, save_every = SAVE_EVERY, lr = LEARNING_RATE, iterations = ITERATIONS, save_progress = SAVE_PROGRESS, out_folder = out_folder, save_latents = True, saved_latents_filepath = r"F:\my\path\magic_man.35.backup", )
can you also update cli.py so the parameter can be passed through the command prompt? |
also should add dill to |
I ran this and hit the following error:
|
@@ -472,6 +495,10 @@ def train_step(self, epoch, i, pbar=None): | |||
num = total_iterations // self.save_every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest moving num
above this if block so it can be used if save_progress hasn't been set to True
So I've tried loading saved latents and changing the text to something completely different, but regardless of the text the image seems to develop in the exact same way. This was "a blue glass orb" after 5 epochs of 50 iterations each: After reloading the latents and running the same epochs and iterations again with text="a red fox" and text_min="a blue glass orb" this is the result: Seems to change in the same way regardless of the prompt though. |
It would be nice to be able to resume with the saved latents either with the same optimizer (continue the same image but refine it) or with a new one (transform the existing image into something different) |
I've added the suggested changes and submitted a second PR - #89 |
it works by dumping/restoring the whole EMA and ADAM optimiser objects
exemple of how to restore :
model = Imagine(
text = TEXT,
save_every = SAVE_EVERY,
lr = LEARNING_RATE,
iterations = ITERATIONS,
save_progress = SAVE_PROGRESS,
out_folder = out_folder,
save_latents = True,
saved_latents_filepath = r"F:\my\path\magic_man.35.backup",
)