lucidrains / DALLE-pytorch

Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: Error(s) in loading state_dict for DALLE

chqwer2 opened this issue · comments

Hi,

I was using "Afiaka DALL-E Generation.ipynb" in Colab, trying to play with Dalle.
Link: https://colab.research.google.com/drive/11V2xw1eLPfZvzW8UQyTUhqCEU71w6Pr4?usp=sharing#scrollTo=682c5804-5f97-469f-8cf1-1cc8356591b8

But I encounter the problem as the title saying, with more info as below:

Missing key(s) in state_dict: "transformer.pos_emb", "transformer.layers.layers.0.0.fn.fn.fn.to_qkv.weight", "transformer.layers.layers.0.0.fn.fn.fn.to_out.0.weight", "transformer.layers.layers.0.0.fn.fn.fn.to_out.0.bias", "transformer.layers.layers.0.0.fn.fn.fn.attn_fn.master_layout", "transformer.layers.layers.0.1.fn.fn.fn.net.0.weight", ...

Unexpected key(s) in state_dict: "text_pos_emb.weight", "image_pos_emb.weights_0", "image_pos_emb.weights_1", "transformer.layers.layers.0.0.fn.fn.to_qkv.weight", "transformer.layers.layers.0.0.fn.fn.to_out.0.weight", "transformer.layers.layers.0.0.fn.fn.to_out.0.bias", "transformer.layers.layers.0.0.fn.fn.attn_fn.master_layout", ...

How can i fix that... I haven't change anything yet,

Hi guys,
I found the answer, change the belowing code in generate.py.

dalle = DALLE(vae = vae, shift_tokens = False, rotary_emb =False, **dalle_params).cuda()