MECT4CNER icon indicating copy to clipboard operation
MECT4CNER copied to clipboard

MSRA数据集

Open Mosquito0352 opened this issue 3 years ago • 3 comments

File "D:\pythonProject\MECT4CNER\model.py", line 122, in forward char_encoded = self.char_encoder(components_embed, embedding, embedding, seq_len, lex_num=lex_num, pos_s=pos_s, File "D:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "D:\pythonProject\MECT4CNER\Modules\TransformerEncoder.py", line 47, in forward output = self.transformer_layer(query, key, value, seq_len, lex_num=lex_num, File "D:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "D:\pythonProject\MECT4CNER\Modules\TransformerEncoderLayer.py", line 47, in forward output = self.attn(query, key, value, seq_len, lex_num=lex_num, File "D:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "D:\pythonProject\MECT4CNER\Modules\AdaptSelfAttention.py", line 87, in forward attn_score_raw = A_C + B_D + self.randomAttention[:, :, :max_seq_len, :max_seq_len] RuntimeError: The size of tensor a (364) must match the size of tensor b (310) at non-singleton dimension 3

Mosquito0352 avatar Jun 21 '22 04:06 Mosquito0352

你这个问题解决了吗?我也遇到了这个问题

lemon0010 avatar Oct 16 '22 15:10 lemon0010

由于数据集切分长度可能不一样,请修改max_len,可以参考这里https://github.com/CoderMusou/MECT4CNER/issues/10

CoderMusou avatar Oct 16 '22 15:10 CoderMusou

好的,谢谢作者

lemon0010 avatar Oct 16 '22 15:10 lemon0010