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

Bug fix: alpha_mask load #1615

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Bug fix: alpha_mask load #1615

merged 1 commit into from
Sep 19, 2024

Conversation

Maru-mee
Copy link
Contributor

@Maru-mee Maru-mee commented Sep 19, 2024

npzからalpha_maskを読み込む時の、reso判定にミスがあったため修正しました。
I fixed the issue with the reso check when importing alpha_mask reso from the npz.

before
・ aspect ratio of img. is 1:1 … Successfully loaded
・ aspect ratio of img. is not 1:1 … Failed to load

after
Both of the above … Successfully loaded


・検証に使用したのは、--alpha_maskオプションではなく、
[[datasets.subsets]]
alpha_mask = true

@Maru-mee Maru-mee marked this pull request as ready for review September 19, 2024 07:28
@Maru-mee Maru-mee marked this pull request as draft September 19, 2024 08:02
@Maru-mee Maru-mee marked this pull request as ready for review September 19, 2024 08:26
@Maru-mee
Copy link
Contributor Author

Maru-mee commented Sep 19, 2024

上記の問題とは別に、alpha_maskについてもう一つ問題があります。
subsetごとにalpha_mask=true/falseが混在していると(例:下記のjson)、alpha_maskを含むnpzが作成されません。確認した結果、すべてのsubsetに対して、subset.alpha_mask=falseの処理が行わていました。

train_util.pyのこの部分に何等かの問題がありそうです。
原因調査中ですが、もしわかる方がいらっしゃいましたら、ご教授の程よろしくお願い致します。

    for batch in tqdm(batches, smoothing=1, total=len(batches)):  
        cache_batch_latents(vae, cache_to_disk, batch, subset.flip_aug, subset.alpha_mask, subset.random_crop)

もしその問題が解決できなくとも、このPR#1615には直接影響はないため、Closeしても問題ありません。


metadata.json
[[datasets.subsets]]
 #folder 1
alpha_mask = ture

[[datasets.subsets]]
 #folder 2
alpha_mask = false

@kohya-ss kohya-ss merged commit 0b7927e into kohya-ss:dev Sep 19, 2024
1 check passed
@kohya-ss
Copy link
Owner

ありがとうございます。マージしました。

alpha_maskが混在しているとnpzが作られない件について簡単に確認しましたが、すぐには分かりませんでした。のちほど時間を取って確認してみます。

@Maru-mee
Copy link
Contributor Author

Maru-mee commented Sep 19, 2024

ありがとうございます。
alpha_mask関係で他にもいくつかバグを発見したので、その件も含めて、私の方でも調査を続けます。

@kohya-ss
Copy link
Owner

お手数お掛けします。alpha_maskは個人的に使っていない機能のためテストが手が回っておりません……。

@Maru-mee
Copy link
Contributor Author

私はよく使っているし勉強のため、ちょっと頑張ってみます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants