kohya-ss / kohya-ss/sd-scripts

size mismatch

Open
#344 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

I launch a training, stop it and want to continue it.

I set the source model as the model of the latest epoch and the resume from saved training state to the latest state folder. Everyelse are similar.

I got this issue:

RuntimeError: Error(s) in loading state_dict for UNet2DConditionModel:
size mismatch for down_blocks.0.attentions.0.proj_in.weight: copying a param with shape torch.Size([320, 320]) from checkpoint, the shape in current model is torch.Size([320, 320, 1, 1]).
size mismatch for down_blocks.0.attentions.0.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([320, 1024]) from checkpoint, the shape in current model is torch.Size([320, 768]).
size mismatch for down_blocks.0.attentions.0.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([320, 1024]) from checkpoint, the shape in current model is torch.Size([320, 768]).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the training-resume flow described: use the latest-epoch model as the source and the latest saved training-state folder as the resume state. Compare the model and resume configurations against the reported UNet2DConditionModel state_dict shapes; done means resuming completes without the listed size-mismatch errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.