xhw205 / GPLinker_torch

CMeIE/CBLUE/CHIP/实体关系抽取/SPO抽取
207 stars 14 forks source link

模型报错了。。RuntimeError: mat1 and mat2 shapes cannot be multiplied (1368x768 and 1024x256) #7

Closed lzf00 closed 2 years ago

lzf00 commented 2 years ago

Traceback (most recent call last): File "/content/drive/MyDrive/GPLinker_torch-main/main.py", line 85, in logits1, logits2, logits3 = net(batch_token_ids, batch_mask_ids, batch_token_type_ids) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, kwargs) File "/content/drive/MyDrive/GPLinker_torch-main/main.py", line 53, in forward mention_outputs = self.mention_detect(outputs, batch_mask_ids) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, *kwargs) File "/content/drive/MyDrive/GPLinker_torch-main/nets/gpNet.py", line 67, in forward outputs = self.dense(last_hidden_state) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(input, kwargs) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/linear.py", line 103, in forward return F.linear(input, self.weight, self.bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (1368x768 and 1024x256)

lzf00 commented 2 years ago

RuntimeError: mat1 and mat2 shapes cannot be multiplied (1224x768 and 1024x256),而且每次运行,这个mat1的矩阵维度会变。。。。。不知道在哪里修改,是设置了随机值吗

xhw205 commented 2 years ago

怎么会出现768,你用的是bert-base吗? 维度每次都变,肯定是random sample的原因,每次mini-batch的长度不会一致

szt852 commented 2 years ago

我也是这个问题,请问作者和楼主解决了吗

ExcaliburPro commented 1 year ago

我也是这个问题,请问作者和楼主解决了吗

您好,我也出现了这个,试了autotokenizer也没用,请问您解决了吗

szt852 commented 1 year ago

没有解决,不过你是从哪里知道我邮箱的啊,我这个问题问了很久了,在哪儿问的我都忘记了

------------------ 原始邮件 ------------------ 发件人: "xhw205/GPLinker_torch" @.>; 发送时间: 2023年3月25日(星期六) 晚上6:34 @.>; @.**@.>; 主题: Re: [xhw205/GPLinker_torch] 模型报错了。。RuntimeError: mat1 and mat2 shapes cannot be multiplied (1368x768 and 1024x256) (Issue #7)

我也是这个问题,请问作者和楼主解决了吗

您好,我也出现了这个,试了autotokenizer也没用,请问您解决了吗

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

xhw205 commented 1 year ago

main.py中 RawGlobalPointer(hiddensize=1024)这些地方对应改成base的hidden size了吗?