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

Transformer Error #3

Open
wac81 opened this issue Jul 13, 2021 · 0 comments
Open

Transformer Error #3

wac81 opened this issue Jul 13, 2021 · 0 comments

Comments

@wac81
Copy link

wac81 commented Jul 13, 2021

try run code:
./train_all_data_at_once.sh Transformer

then get error

Traceback (most recent call last):
  File "run.py", line 352, in <module>
    main()
  File "run.py", line 329, in main
    train(args, model, tokenizer, device, optimizer, tbwriter)
  File "/home/wac/SentenceSimilarity/random_train.py", line 55, in train
    output = model(input_1, input_2)
  File "/home/wac/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/wac/SentenceSimilarity/models/rcnn_transformer.py", line 82, in forward
    res_sub = self.fc_sub(sentence1, sentence2)
  File "/home/wac/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/wac/SentenceSimilarity/models/rcnn_elements.py", line 17, in forward
    out = self.dense(res_sub_mul)
  File "/home/wac/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/wac/.local/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 91, in forward
    return F.linear(input, self.weight, self.bias)
  File "/home/wac/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 1674, in linear
    ret = torch.addmm(bias, input, weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0

maybe dim sentence1 different from sentence2?

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