mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 22:35:09 +00:00
Merge pull request #1278 from Cauldrath/catch_latent_error_file
Display name of error latent file
This commit is contained in:
@@ -2123,6 +2123,7 @@ def is_disk_cached_latents_is_expected(reso, npz_path: str, flip_aug: bool):
|
|||||||
if not os.path.exists(npz_path):
|
if not os.path.exists(npz_path):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
npz = np.load(npz_path)
|
npz = np.load(npz_path)
|
||||||
if "latents" not in npz or "original_size" not in npz or "crop_ltrb" not in npz: # old ver?
|
if "latents" not in npz or "original_size" not in npz or "crop_ltrb" not in npz: # old ver?
|
||||||
return False
|
return False
|
||||||
@@ -2134,6 +2135,10 @@ def is_disk_cached_latents_is_expected(reso, npz_path: str, flip_aug: bool):
|
|||||||
return False
|
return False
|
||||||
if npz["latents_flipped"].shape[1:3] != expected_latents_size:
|
if npz["latents_flipped"].shape[1:3] != expected_latents_size:
|
||||||
return False
|
return False
|
||||||
|
except Exception as e:
|
||||||
|
print(npz_path)
|
||||||
|
print(e)
|
||||||
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user