yuhaozhang / tacred-relation

PyTorch implementation of the position-aware attention model for relation extraction
Other
355 stars 97 forks source link

RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 2. Got 66 and 67 in dimension 1 at /Users/distiller/project/conda/conda-bld/pytorch_1556653464916/work/aten/src/TH/generic/THTensor.cpp:711 #10

Closed JakeNocentino closed 5 years ago

JakeNocentino commented 5 years ago

I keep getting this error whenever I run the training script and I have no idea how to fix it. This is what the exact error looks like:

Traceback (most recent call last): File "train.py", line 117, in loss = model.update(batch) File "rnn.py", line 50, in update logits, _ = self.model(inputs) File "/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "rnn.py", line 185, in forward inputs = self.drop(torch.cat(inputs, dim=2)) # add dropout to input RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 2. Got 66 and 67 in dimension 1 at /Users/distiller/project/conda/conda-bld/pytorch_1556653464916/work/aten/src/TH/generic/THTensor.cpp:711

demongolem-biz commented 2 years ago

What was the solution. I have this same mismatch with 9 and 10 instead of 66 and 67