FewRel icon indicating copy to clipboard operation
FewRel copied to clipboard

metanet代码怎么跑

Open icoderzqliu opened this issue 3 years ago • 1 comments

在metanet的代码中这里传入了None

fewshot_re_kit.framework.FewShotREModel.__init__(self, None)

但是在FewShotREModel中Dataparallel需要传入参数,否则报错

class FewShotREModel(nn.Module):
    def __init__(self, my_sentence_encoder):
        '''
        sentence_encoder: Sentence encoder
        
        You need to set self.cost as your own loss function.
        '''
        nn.Module.__init__(self)
        self.sentence_encoder = nn.DataParallel(my_sentence_encoder)
        self.cost = nn.CrossEntropyLoss()

我把metanet里的代码改为了

fewshot_re_kit.framework.FewShotREModel.__init__(self, embedding)

但是后面又出现了报错 请问要怎样操作或者配置参数才能成功跑通metanet的代码并复现论文中的结果呢?望解答,谢谢!

icoderzqliu avatar Dec 18 '21 15:12 icoderzqliu

@Henry-soul ** Henry**

你好,我只跑通了proto,并未提交测试

icoderzqliu avatar Dec 21 '21 03:12 icoderzqliu