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

加载模型权重文件anytext_v1.1.ckpt报错 #131

Closed
Hxiangdou opened this issue Nov 8, 2024 · 3 comments
Closed

加载模型权重文件anytext_v1.1.ckpt报错 #131

Hxiangdou opened this issue Nov 8, 2024 · 3 comments

Comments

@Hxiangdou
Copy link

加载模型权重文件报错model.load_state_dict(load_state_dict(args.ckpt_path, location='cuda'))
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ControlLDM:
Missing key(s) in state_dict: "embedding_manager.proj.0.weight", "embedding_manager.proj.0.bias", "embedding_manager.proj.1.weight", "embedding_manager.proj.1.bias".
Unexpected key(s) in state_dict: "cond_stage_model.transformer.text_model.embeddings.position_ids", "embedding_manager.proj.weight", "embedding_manager.proj.bias".

@chenxinhua
Copy link

同样遇到

@tyxsspa
Copy link
Owner

tyxsspa commented Nov 8, 2024

对齐一下transformer 版本
open-mmlab/PIA#13 (comment)

@Hxiangdou
Copy link
Author

修改了./cldm/embedding_manager.py的105行,

self.proj = nn.Sequential( zero_module(linear(40*64, token_dim)), nn.LayerNorm(token_dim) )
改为
self.proj = zero_module(linear(40*64, token_dim))

修改后可以正常运行,同时要保证transformer版本与environment.yaml相同。

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

No branches or pull requests

3 participants