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

Error with work.sh on CRF model #31

Open
andreasvc opened this issue Jun 28, 2021 · 2 comments
Open

Error with work.sh on CRF model #31

andreasvc opened this issue Jun 28, 2021 · 2 comments

Comments

@andreasvc
Copy link
Contributor

Hi there,
Running work.sh on a tfm model works fine, but with crf I get the following error:

Load checkpoint ./bert-crf-bookreviews-finetune/checkpoint-1200/pytorch_model.bin...
cached_features_file: ./data/bookreviews/cached_test_bert-base-cased_128_bookreviews
***** Running prediction *****
Evaluating:   0%|▏                                                                                                                                             | 1/800 [00:00<01:51,  7.17it/s]
Traceback (most recent call last):
  File "work.py", line 216, in <module>
    main()
  File "work.py", line 125, in main
    predict(args, model, tokenizer)
  File "work.py", line 200, in predict
    total_preds = np.append(total_preds, preds, axis=0)
  File "<__array_function__ internals>", line 6, in append
  File "/home/p286012/.local/lib/python3.7/site-packages/numpy/lib/function_base.py", line 4745, in append
    return concatenate((arr, values), axis=axis)
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 12 and the array at index 1 has size 19

Any idea what's wrong? Training did work.

@lixin4ever
Copy link
Owner

I will try to reproduce this issue first in my spare time, stay tuned

@lixin4ever
Copy link
Owner

@andreasvc hello, I have fixed this issue by removing the metric computation part. You can check the latest commit for more details.

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

2 participants