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

gpt2 and gpt-j load error: tensor has wrong shape in model file #63

Closed
loretoparisi opened this issue Apr 3, 2023 · 1 comment
Closed

Comments

@loretoparisi
Copy link

Hello after latest update I get an error when running the gpt-2 model:

 % ./bin/gpt-2 -m models/gpt-2-1558M/ggml-model.bin -p "Donald Trump is"
main: seed = 1680541533
gpt2_model_load: loading model from 'models/gpt-2-1558M/ggml-model.bin'
gpt2_model_load: n_vocab = 50257
gpt2_model_load: n_ctx   = 1024
gpt2_model_load: n_embd  = 1600
gpt2_model_load: n_head  = 25
gpt2_model_load: n_layer = 48
gpt2_model_load: f16     = 1
gpt2_model_load: ggml ctx size = 3729.46 MB
gpt2_model_load: memory size =   600.00 MB, n_mem = 49152
gpt2_model_load: tensor 'model/h0/attn/c_attn/w' has wrong shape in model file: got [1600, 4800], expected [4800, 1600]
main: failed to load model from 'models/gpt-2-1558M/ggml-model.bin'

and even the gpt-j model:

% ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin -p "James Dean was"
main: seed = 1680541576
gptj_model_load: loading model from 'models/gpt-j-6B/ggml-model.bin' - please wait ...
gptj_model_load: n_vocab = 50400
gptj_model_load: n_ctx   = 2048
gptj_model_load: n_embd  = 4096
gptj_model_load: n_head  = 16
gptj_model_load: n_layer = 28
gptj_model_load: n_rot   = 64
gptj_model_load: f16     = 1
gptj_model_load: ggml ctx size = 13334.86 MB
gptj_model_load: memory_size =  1792.00 MB, n_mem = 57344
gptj_model_load: tensor 'transformer.h.0.mlp.fc_in.weight' has wrong shape in model file: got [4096, 16384], expected [16384, 4096]
main: failed to load model from 'models/gpt-j-6B/ggml-model.bin'
gptj_model_load: % 
@adtreat
Copy link

adtreat commented Apr 6, 2023

This is duplicate of #52 and the issue is that you need a newer quantized bin. This should be closed.

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