When I run:
python src/main.py parse --input-path best_models/raw_sentences.txt --output-path best_models/parsed_sentences.txt --model-path-base best_models/swbd_fisher_bert_Edev.0.9078.pt >best_models/out.log
I get the error:
File "src/main.py", line 657, in
main()
File "src/main.py", line 653, in main
args.callback(args)
File "src/main.py", line 530, in runparse
predicted, = parser.parse_batch(subbatch_sentences)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 1027, in parsebatch
annotations, = self.encoder(emb_idxs, batch_idxs, extra_content_annotations=extra_content_annotations)
File "/mnt/home/v_shizhan03/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, *kwargs)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 615, in forward
res, current_attns = attn(res, batch_idxs)
File "/mnt/home/v_shizhan03/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(input, **kwargs)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 358, in forward
return self.layer_norm(outputs + residual), attns_padded
RuntimeError: The size of tensor a (102) must match the size of tensor b (82) at non-singleton dimension 0
When I run: python src/main.py parse --input-path best_models/raw_sentences.txt --output-path best_models/parsed_sentences.txt --model-path-base best_models/swbd_fisher_bert_Edev.0.9078.pt >best_models/out.log
I get the error: File "src/main.py", line 657, in
main()
File "src/main.py", line 653, in main
args.callback(args)
File "src/main.py", line 530, in runparse
predicted, = parser.parse_batch(subbatch_sentences)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 1027, in parsebatch
annotations, = self.encoder(emb_idxs, batch_idxs, extra_content_annotations=extra_content_annotations)
File "/mnt/home/v_shizhan03/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, *kwargs)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 615, in forward
res, current_attns = attn(res, batch_idxs)
File "/mnt/home/v_shizhan03/anaconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(input, **kwargs)
File "/mnt/home/v_shizhan03/joint-disfluency-detector-and-parser/src/parse_nk.py", line 358, in forward
return self.layer_norm(outputs + residual), attns_padded
RuntimeError: The size of tensor a (102) must match the size of tensor b (82) at non-singleton dimension 0
Any clues?