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

lycoris: resume should use less vram now #835

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion helpers/training/save_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,11 @@ def _load_lycoris(self, models, input_dir):
if len(state.keys()) > 0:
logging.error(f"LyCORIS failed to load: {state}")
raise RuntimeError("Loading of LyCORIS model failed")
self.accelerator._lycoris_wrapped_network.to(self.accelerator.device)
self.accelerator._lycoris_wrapped_network.to(
device=self.accelerator.device, dtype=self.transformer.dtype
)
# print(f"transformer dtype: {self.transformer.dtype}")
# print(f"lycoris dtype: {self.accelerator._lycoris_wrapped_network}")

logger.info("LyCORIS weights have been loaded from disk")

Expand Down
Loading