Fixed issue with loadin models after resume function added. Added additional flush if not training text encoder to clear out vram before grad accum

This commit is contained in:
Jaret Burkett
2023-08-28 17:56:30 -06:00
parent b79ced3e10
commit a008d9e63b
3 changed files with 18 additions and 6 deletions

View File

@@ -86,13 +86,14 @@ class BaseSDTrainProcess(BaseTrainProcess):
if embedding_raw is not None:
self.embed_config = EmbeddingConfig(**embedding_raw)
if self.embed_config is None and self.network_config is None:
# get the latest checkpoint
# check to see if we have a latest save
latest_save_path = self.get_latest_save_path()
# check to see if we have a latest save
latest_save_path = self.get_latest_save_path()
if latest_save_path is not None:
print(f"#### IMPORTANT RESUMING FROM {latest_save_path} ####")
self.model_config.name_or_path = latest_save_path
if latest_save_path is not None:
print(f"#### IMPORTANT RESUMING FROM {latest_save_path} ####")
self.model_config.name_or_path = latest_save_path
self.sd = StableDiffusion(
device=self.device,