chloerobotics / chloebot

chloe is an end to end neural network chatbot written in PyTorch based on the transformer. Accomplishing goals through conversation is a task we can all relate to, thus chatbots are an ideal agent through which to connect new research to our current understanding of AI and demonstrate how new research brings us closer to human level intelligence or not
30 stars 8 forks source link

error when loading pretrained weights #5

Open javismiles opened 4 years ago

javismiles commented 4 years ago

When running this line chloe.load_state_dict(torch.load(opt.save_path))

in trainer notebook. All is being ran as it was originally

I get this error: RuntimeError: Error(s) in loading state_dict for Transformer: Unexpected key(s) in state_dict: "rmc.attn_mem_update.q_linear.weight", "rmc.attn_mem_update.q_linear.bias", "rmc.attn_mem_update.k_linear.weight", "rmc.attn_mem_update.k_linear.bias", "rmc.attn_mem_update.v_linear.weight", "rmc.attn_mem_update.v_linear.bias", "rmc.attn_mem_update.out.weight", "rmc.attn_mem_update.out.bias", "rmc.normalizeMemory1.alpha", "rmc.normalizeMemory1.bias", "rmc.normalizeMemory2.alpha", "rmc.normalizeMemory2.bias", "rmc.MLP.linear_1.weight", "rmc.MLP.linear_1.bias", "rmc.MLP.linear_2.weight", "rmc.MLP.linear_2.bias", "rmc.ZGATE.weight", "rmc.ZGATE.bias", "mem_encoder.q_linear.weight", "mem_encoder.q_linear.bias", "mem_encoder.k_linear.weight", "mem_encoder.k_linear.bias", "mem_encoder.v_linear.weight", "mem_encoder.v_linear.bias", "mem_encoder.out.weight", "mem_encoder.out.bias". size mismatch for encoder.embed.embed.weight: copying a param with shape torch.Size([50, 32]) from checkpoint, the shape in current model is torch.Size([48, 32]). size mismatch for decoder.embed.embed.weight: copying a param with shape torch.Size([74, 32]) from checkpoint, the shape in current model is torch.Size([66, 32]). size mismatch for out.weight: copying a param with shape torch.Size([74, 32]) from checkpoint, the shape in current model is torch.Size([66, 32]). size mismatch for out.bias: copying a param with shape torch.Size([74]) from checkpoint, the shape in current model is torch.Size([66]).

wenxiong-xu commented 3 years ago

I got the same mistake.