Skip to content

Display name of error latent file #1278

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

Merged
merged 2 commits into from
May 12, 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
23 changes: 14 additions & 9 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,18 +2123,23 @@
if not os.path.exists(npz_path):
return False

npz = np.load(npz_path)
if "latents" not in npz or "original_size" not in npz or "crop_ltrb" not in npz: # old ver?
return False
if npz["latents"].shape[1:3] != expected_latents_size:
return False

if flip_aug:
if "latents_flipped" not in npz:
try:
npz = np.load(npz_path)
if "latents" not in npz or "original_size" not in npz or "crop_ltrb" not in npz: # old ver?
return False
if npz["latents_flipped"].shape[1:3] != expected_latents_size:
if npz["latents"].shape[1:3] != expected_latents_size:
return False

if flip_aug:
if "latents_flipped" not in npz:
return False
if npz["latents_flipped"].shape[1:3] != expected_latents_size:
return False
except Exception as e:
print(npz_path)
print(e)
return False

return True


Expand Down Expand Up @@ -3087,7 +3092,7 @@
)
parser.add_argument("--seed", type=int, default=None, help="random seed for training / 学習時の乱数のseed")
parser.add_argument(
"--gradient_checkpointing", action="store_true", help="enable gradient checkpointing / grandient checkpointingを有効にする"

Check warning on line 3095 in library/train_util.py

View workflow job for this annotation

GitHub Actions / build

"grandient" should be "gradient".
)
parser.add_argument(
"--gradient_accumulation_steps",
Expand Down
Loading