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

issue about text_encoder #1

Open
aihaozi opened this issue Jan 17, 2023 · 4 comments
Open

issue about text_encoder #1

aihaozi opened this issue Jan 17, 2023 · 4 comments

Comments

@aihaozi
Copy link

aihaozi commented Jan 17, 2023

Hello, I encountered bugs when I run the code. "text_encoder = CLIPTextModel.from_pretrained("openai/clip-vit-large-patch14").to(device)"
something like that:
..size mismatch for text_model.encoder.layers.11.mlp.fc2.bias: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for text_model.encoder.layers.11.layer_norm2.weight: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for text_model.encoder.layers.11.layer_norm2.bias: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for text_model.final_layer_norm.weight: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for text_model.final_layer_norm.bias: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([512]).

Could you help me fix it?

@aihaozi
Copy link
Author

aihaozi commented Jan 17, 2023

@ogkalu2 Hello, I met another bug: AttributeError: type object 'DDPMScheduler' has no attribute 'from_pretrained'.
What is the version of transformers and diffusers you used?

@ogkalu2
Copy link
Owner

ogkalu2 commented Jan 17, 2023

For the first, replace "openai/clip-vit-large-patch14" with args.unet for both the tokenizer and text encoder and see if that works. Looks like you're trying to train on v2 or 2.1 correct ?

For the second, pick another scheduler or replace .from_pretrained("runwayml/stable-diffusion-v1-5", subfolder="scheduler") with (beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", num_train_timesteps=1000). I used PNDMScheduler as that's the default for SD. Although i'm not sure why you're having that error.

@aihaozi
Copy link
Author

aihaozi commented Jan 18, 2023

Hi, what is the version of transformers and diffusers package you used?

@ogkalu2
Copy link
Owner

ogkalu2 commented Jan 18, 2023

I used the latest versions of both. Just pip install diffusers/transformers. Trained on a vast.ai instance

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

2 participants