modelscope / modelscope/DiffSynth-Studio

Error loading DinoV3 state dict

Open
#1,378 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.1k
Forks
1.3k
Avg merge
13h 12m
Merged PRs (30d)
45

Description

Hello, I'm having trouble loading the DINOV3ImageEncoder model from the example implementation given here:
https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/z_image/model_inference_low_vram/Z-Image-i2L.py

When I try to run the code verbatim, I get the following while loading the model. Any insights?

RuntimeError: Error(s) in loading state_dict for DINOv3ImageEncoder:
	Missing key(s) in state_dict: "model.layer.0.norm1.weight", "model.layer.0.norm1.bias", "model.layer.0.attention.k_proj.weight", "model.layer.0.attention.v_proj.weight", "model.layer.0.attention.q_proj.weight", "model.layer.0.attention.o_proj.weight", ...
	Unexpected key(s) in state_dict: "layer.0.attention.k_proj.weight", "layer.0.attention.o_proj.bias", "layer.0.attention.o_proj.weight", "layer.0.attention.q_proj.weight", "layer.0.attention.v_proj.weight", "layer.0.layer_scale1.lambda1", "layer.0.layer_scale2.lambda1", "layer.0.mlp.down_proj.bias", "layer.0.mlp.down_proj.weight", "layer.0.mlp.gate_proj.bias", "layer.0.mlp.gate_proj.weight", "layer.0.mlp.up_proj.bias", "layer.0.mlp.up_proj.weight", "layer.0.norm1.bias", "layer.0.norm1.weight", ...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/z_image/model_inference_low_vram/Z-Image-i2L.py and trace how DINOv3ImageEncoder loads its state dict. Compare the expected keys beginning with "model." against the checkpoint keys beginning with "layer." and inspect the relevant model-loading entry point. Done means the example loads the encoder without missing or unexpected state-dict keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.