Skip to content

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 1 and 14 in dimension 0 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:71 #3

@luckysunda

Description

@luckysunda

In line 53, word_embedded, pretrain_embedded and lemma_embedded, these three are of different dimensions, so they clearly cannot be concatenated.

embeds = self.tanh(self.embeds2input(torch.cat((word_embedded, pretrain_embedded, lemma_embedded), 1))).view(len(sentence[0]),1,-1)
    

How to run the prediction, please help.

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