Skip to content

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

Open
@huangshuai-ustc

Description

@huangshuai-ustc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions