Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bert-lstm-crf_run.py #31

Open
Kingsuuun opened this issue Dec 19, 2021 · 0 comments
Open

bert-lstm-crf_run.py #31

Kingsuuun opened this issue Dec 19, 2021 · 0 comments

Comments

@Kingsuuun
Copy link

Traceback (most recent call last):
File "run.py", line 138, in
run()
File "run.py", line 134, in run
train(train_loader, dev_loader, model, optimizer, scheduler, config.model_dir)
File "/home/ym/test2/CLU/BERT-LSTM-CRF/train.py", line 47, in train
train_epoch(train_loader, model, optimizer, scheduler, epoch)
File "/home/ym/test2/CLU/BERT-LSTM-CRF/train.py", line 22, in train_epoch
token_type_ids=None, attention_mask=batch_masks, labels=batch_labels)[0]
File "/home/ym/anaconda3/envs/test/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ym/test2/CLU/BERT-LSTM-CRF/model.py", line 52, in forward
logits = self.classifier(lstm_output)
File "/home/ym/anaconda3/envs/test/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ym/anaconda3/envs/test/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 103, in forward
return F.linear(input, self.weight, self.bias)
File "/home/ym/anaconda3/envs/test/lib/python3.7/site-packages/torch/nn/functional.py", line 1848, in linear
return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1600x2048 and 1024x31)

please help me😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant