Skip to content

Commit

Permalink
Regenerate failed file
Browse files Browse the repository at this point in the history
If a latent file fails to load, print out the path and the error, then return false to regenerate it
  • Loading branch information
Cauldrath committed Apr 21, 2024
1 parent feefcf2 commit 040e26f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2135,8 +2135,10 @@ def is_disk_cached_latents_is_expected(reso, npz_path: str, flip_aug: bool):
return False
if npz["latents_flipped"].shape[1:3] != expected_latents_size:
return False
except:
raise RuntimeError(f"Error loading file: {npz_path}")
except Exception as e:
print(npz_path)
print(e)
return False

return True

Expand Down

0 comments on commit 040e26f

Please sign in to comment.