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

在预测的时候遇到ValueError: expected sequence of length 517 at dim 1 (got 512)怎么办,下面是详细报错内容 #97

Open
huangshuai-ustc opened this issue Sep 10, 2023 · 0 comments

Comments

@huangshuai-ustc
Copy link

Traceback (most recent call last):
File "run_ner_crf.py", line 498, in
main()
File "run_ner_crf.py", line 493, in main
predict(args, model, tokenizer, prefix=prefix)
File "run_ner_crf.py", line 255, in predict
test_dataset = load_and_cache_examples(args, args.task_name, tokenizer, data_type='test')
File "run_ner_crf.py", line 368, in load_and_cache_examples
all_label_ids = torch.tensor([f.label_ids for f in features], dtype=torch.long)
ValueError: expected sequence of length 517 at dim 1 (got 512)

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