Skip to content

metanet代码怎么跑 #72

@icoderzqliu

Description

@icoderzqliu

在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的代码并复现论文中的结果呢?望解答,谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions