naver / sqlova

Apache License 2.0
631 stars 168 forks source link

Loading Pretrained SQLova Parameters #13

Open jaurment opened 5 years ago

jaurment commented 5 years ago

I'm having an error when trying to load the pretrained parameters. Seems like the file may be missing some keys?

Any help you could provide will be much appreciated.

self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for FT_Scalar_1: Unexpected key(s) in state_dict: "wcp.enc_h.weight_ih_l0", "wcp.enc_h.weight_hh_l0", "wcp.enc_h.bias_ih_l0", "wcp.enc_h.bias_hh_l0", "wcp.enc_h.weight_ih_l0_reverse", "wcp.enc_h.weight_hh_l0_reverse", "wcp.enc_h.bias_ih_l0_reverse", "wcp.enc_h.bias_hh_l0_reverse", "wcp.enc_h.weight_ih_l1", "wcp.enc_h.weight_hh_l1", "wcp.enc_h.bias_ih_l1", "wcp.enc_h.bias_hh_l1", "wcp.enc_h.weight_ih_l1_reverse", "wcp.enc_h.weight_hh_l1_reverse", "wcp.enc_h.bias_ih_l1_reverse", "wcp.enc_h.bias_hh_l1_reverse", "wcp.enc_n.weight_ih_l0", "wcp.enc_n.weight_hh_l0", "wcp.enc_n.bias_ih_l0", "wcp.enc_n.bias_hh_l0", "wcp.enc_n.weight_ih_l0_reverse", "wcp.enc_n.weight_hh_l0_reverse", "wcp.enc_n.bias_ih_l0_reverse", "wcp.enc_n.bias_hh_l0_reverse", "wcp.enc_n.weight_ih_l1", "wcp.enc_n.weight_hh_l1", "wcp.enc_n.bias_ih_l1", "wcp.enc_n.bias_hh_l1", "wcp.enc_n.weight_ih_l1_reverse", "wcp.enc_n.weight_hh_l1_reverse", "wcp.enc_n.bias_ih_l1_reverse", "wcp.enc_n.bias_hh_l1_reverse", "wcp.W_att.weight", "wcp.W_att.bias", "wcp.W_c.weight", "wcp.W_c.bias", "wcp.W_hs.weight", "wcp.W_hs.bias", "wcp.W_out.1.weight", "wcp.W_out.1.bias", "scp.enc_h.weight_ih_l0", "scp.enc_h.weight_hh_l0", "scp.enc_h.bias_ih_l0", "scp.enc_h.bias_hh_l0", "scp.enc_h.weight_ih_l0_reverse", "scp.enc_h.weight_hh_l0_reverse", "scp.enc_h.bias_ih_l0_reverse", "scp.enc_h.bias_hh_l0_reverse", "scp.enc_h.weight_ih_l1", "scp.enc_h.weight_hh_l1", "scp.enc_h.bias_ih_l1", "scp.enc_h.bias_hh_l1", "scp.enc_h.weight_ih_l1_reverse", "scp.enc_h.weight_hh_l1_reverse", "scp.enc_h.bias_ih_l1_reverse", "scp.enc_h.bias_hh_l1_reverse", "scp.enc_n.weight_ih_l0", "scp.enc_n.weight_hh_l0", "scp.enc_n.bias_ih_l0", "scp.enc_n.bias_hh_l0", "scp.enc_n.weight_ih_l0_reverse", "scp.enc_n.weight_hh_l0_reverse", "scp.enc_n.bias_ih_l0_reverse", "scp.enc_n.bias_hh_l0_reverse", "scp.enc_n.weight_ih_l1", "scp.enc_n.weight_hh_l1", "scp.enc_n.bias_ih_l1", "scp.enc_n.bias_hh_l1", "scp.enc_n.weight_ih_l1_reverse", "scp.enc_n.weight_hh_l1_reverse", "scp.enc_n.bias_ih_l1_reverse", "scp.enc_n.bias_hh_l1_reverse", "scp.W_att.weight", "scp.W_att.bias", "scp.W_c.weight", "scp.W_c.bias", "scp.W_hs.weight", "scp.W_hs.bias", "scp.sc_out.1.weight", "scp.sc_out.1.bias", "sap.enc_h.weight_ih_l0", "sap.enc_h.weight_hh_l0", "sap.enc_h.bias_ih_l0", "sap.enc_h.bias_hh_l0", "sap.enc_h.weight_ih_l0_reverse", "sap.enc_h.weight_hh_l0_reverse", "sap.enc_h.bias_ih_l0_reverse", "sap.enc_h.bias_hh_l0_reverse", "sap.enc_h.weight_ih_l1", "sap.enc_h.weight_hh_l1", "sap.enc_h.bias_ih_l1", "sap.enc_h.bias_hh_l1", "sap.enc_h.weight_ih_l1_reverse", "sap.enc_h.weight_hh_l1_reverse", "sap.enc_h.bias_ih_l1_reverse", "sap.enc_h.bias_hh_l1_reverse", "sap.enc_n.weight_ih_l0", "sap.enc_n.weight_hh_l0", "sap.enc_n.bias_ih_l0", "sap.enc_n.bias_hh_l0", "sap.enc_n.weight_ih_l0_reverse", "sap.enc_n.weight_hh_l0_reverse", "sap.enc_n.bias_ih_l0_reverse", "sap.enc_n.bias_hh_l0_reverse", "sap.enc_n.weight_ih_l1", "sap.enc_n.weight_hh_l1", "sap.enc_n.bias_ih_l1", "sap.enc_n.bias_hh_l1", "sap.enc_n.weight_ih_l1_reverse", "sap.enc_n.weight_hh_l1_reverse", "sap.enc_n.bias_ih_l1_reverse", "sap.enc_n.bias_hh_l1_reverse", "sap.W_att.weight", "sap.W_att.bias", "sap.sa_out.0.weight", "sap.sa_out.0.bias", "sap.sa_out.2.weight", "sap.sa_out.2.bias", "wnp.enc_h.weight_ih_l0", "wnp.enc_h.weight_hh_l0", "wnp.enc_h.bias_ih_l0", "wnp.enc_h.bias_hh_l0", "wnp.enc_h.weight_ih_l0_reverse", "wnp.enc_h.weight_hh_l0_reverse", "wnp.enc_h.bias_ih_l0_reverse", "wnp.enc_h.bias_hh_l0_reverse", "wnp.enc_h.weight_ih_l1", "wnp.enc_h.weight_hh_l1", "wnp.enc_h.bias_ih_l1", "wnp.enc_h.bias_hh_l1", "wnp.enc_h.weight_ih_l1_reverse", "wnp.enc_h.weight_hh_l1_reverse", "wnp.enc_h.bias_ih_l1_reverse", "wnp.enc_h.bias_hh_l1_reverse", "wnp.enc_n.weight_ih_l0", "wnp.enc_n.weight_hh_l0", "wnp.enc_n.bias_ih_l0", "wnp.enc_n.bias_hh_l0", "wnp.enc_n.weight_ih_l0_reverse", "wnp.enc_n.weight_hh_l0_reverse", "wnp.enc_n.bias_ih_l0_reverse", "wnp.enc_n.bias_hh_l0_reverse", "wnp.enc_n.weight_ih_l1", "wnp.enc_n.weight_hh_l1", "wnp.enc_n.bias_ih_l1", "wnp.enc_n.bias_hh_l1", "wnp.enc_n.weight_ih_l1_reverse", "wnp.enc_n.weight_hh_l1_reverse", "wnp.enc_n.bias_ih_l1_reverse", "wnp.enc_n.bias_hh_l1_reverse", "wnp.W_att_h.weight", "wnp.W_att_h.bias", "wnp.W_hidden.weight", "wnp.W_hidden.bias", "wnp.W_cell.weight", "wnp.W_cell.bias", "wnp.W_att_n.weight", "wnp.W_att_n.bias", "wnp.wn_out.0.weight", "wnp.wn_out.0.bias", "wnp.wn_out.2.weight", "wnp.wn_out.2.bias", "wop.enc_h.weight_ih_l0", "wop.enc_h.weight_hh_l0", "wop.enc_h.bias_ih_l0", "wop.enc_h.bias_hh_l0", "wop.enc_h.weight_ih_l0_reverse", "wop.enc_h.weight_hh_l0_reverse", "wop.enc_h.bias_ih_l0_reverse", "wop.enc_h.bias_hh_l0_reverse", "wop.enc_h.weight_ih_l1", "wop.enc_h.weight_hh_l1", "wop.enc_h.bias_ih_l1", "wop.enc_h.bias_hh_l1", "wop.enc_h.weight_ih_l1_reverse", "wop.enc_h.weight_hh_l1_reverse", "wop.enc_h.bias_ih_l1_reverse", "wop.enc_h.bias_hh_l1_reverse", "wop.enc_n.weight_ih_l0", "wop.enc_n.weight_hh_l0", "wop.enc_n.bias_ih_l0", "wop.enc_n.bias_hh_l0", "wop.enc_n.weight_ih_l0_reverse", "wop.enc_n.weight_hh_l0_reverse", "wop.enc_n.bias_ih_l0_reverse", "wop.enc_n.bias_hh_l0_reverse", "wop.enc_n.weight_ih_l1", "wop.enc_n.weight_hh_l1", "wop.enc_n.bias_ih_l1", "wop.enc_n.bias_hh_l1", "wop.enc_n.weight_ih_l1_reverse", "wop.enc_n.weight_hh_l1_reverse", "wop.enc_n.bias_ih_l1_reverse", "wop.enc_n.bias_hh_l1_reverse", "wop.W_att.weight", "wop.W_att.bias", "wop.W_c.weight", "wop.W_c.bias", "wop.W_hs.weight", "wop.W_hs.bias", "wop.wo_out.0.weight", "wop.wo_out.0.bias", "wop.wo_out.2.weight", "wop.wo_out.2.bias", "wvp.enc_h.weight_ih_l0", "wvp.enc_h.weight_hh_l0", "wvp.enc_h.bias_ih_l0", "wvp.enc_h.bias_hh_l0", "wvp.enc_h.weight_ih_l0_reverse", "wvp.enc_h.weight_hh_l0_reverse", "wvp.enc_h.bias_ih_l0_reverse", "wvp.enc_h.bias_hh_l0_reverse", "wvp.enc_h.weight_ih_l1", "wvp.enc_h.weight_hh_l1", "wvp.enc_h.bias_ih_l1", "wvp.enc_h.bias_hh_l1", "wvp.enc_h.weight_ih_l1_reverse", "wvp.enc_h.weight_hh_l1_reverse", "wvp.enc_h.bias_ih_l1_reverse", "wvp.enc_h.bias_hh_l1_reverse", "wvp.enc_n.weight_ih_l0", "wvp.enc_n.weight_hh_l0", "wvp.enc_n.bias_ih_l0", "wvp.enc_n.bias_hh_l0", "wvp.enc_n.weight_ih_l0_reverse", "wvp.enc_n.weight_hh_l0_reverse", "wvp.enc_n.bias_ih_l0_reverse", "wvp.enc_n.bias_hh_l0_reverse", "wvp.enc_n.weight_ih_l1", "wvp.enc_n.weight_hh_l1", "wvp.enc_n.bias_ih_l1", "wvp.enc_n.bias_hh_l1", "wvp.enc_n.weight_ih_l1_reverse", "wvp.enc_n.weight_hh_l1_reverse", "wvp.enc_n.bias_ih_l1_reverse", "wvp.enc_n.bias_hh_l1_reverse", "wvp.W_att.weight", "wvp.W_att.bias", "wvp.W_c.weight", "wvp.W_c.bias", "wvp.W_hs.weight", "wvp.W_hs.bias", "wvp.W_op.weight", "wvp.W_op.bias", "wvp.wv_out.0.weight", "wvp.wv_out.0.bias", "wvp.wv_out.2.weight", "wvp.wv_out.2.bias".

whwang299 commented 5 years ago

Hi @jaurment

The uploaded model parameter is of "Seq2SQL_v1" (NL2SQL-Layer) not of "FB_Scalar_1" (Shallow-Layer).

Thanks!

Wonseok

zyc1310517843 commented 5 years ago

你的类别加载错了,有两个类别: map_bert_type_abb = {'uS': 'uncased_L-12_H-768_A-12', 'uL': 'uncased_L-24_H-1024_A-16'} 作者预训练模型用的是uL,模型默认加载uS,改一下参数就好了。 I use Chinese, you can translate it.

Tianchen627 commented 4 years ago

你的类别加载错了,有两个类别: map_bert_type_abb = {'uS': 'uncased_L-12_H-768_A-12', 'uL': 'uncased_L-24_H-1024_A-16'} 作者预训练模型用的是uL,模型默认加载uS,改一下参数就好了。 I use Chinese, you can translate it.

老哥我歪个楼。我RTX 2080跑这段代码,GPU使用率极低(就是没用和常态一样)CPU使用率极高(50%~100%)。这个正常不?cuda配置都是正常的