question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load labels from old models

See original GitHub issue

❓ Questions & Help

If I load a model from 2.8 or older in 2.9 o newer, the labels from my model are changed automatically so all the tests in my code start to fail because instead of predicting I-PER it predicts LABEL_2.

After reading the source code I think I found what happens but I’m not quite sure. I think it all started here in #3967

https://github.com/huggingface/transformers/blob/e7cfc1a313cc928e962bb8699868f5dcf46f11eb/src/transformers/configuration_utils.py#L123

In the code above you can see that the labels dicts are modified if we set num_labels. I couldn’t find the place in the code where that is done, but it definetly modifies 2 attributes from the class. I don’t really think that a setter for attribute A, should change attributes B and C.

Am I missing something when loading my models?

Thanks you so much for reading and for the library, we all love it ❤️

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
julien-ccommented, Jun 1, 2020

@GuillemGSubies Thanks for reporting, I can reproduce this issue.

To fix it on your side while we push a fix, you can just remove the num_labels attribute from your config.json, it’s not needed anymore. Let me know if this solves your issue.

0reactions
julien-ccommented, Jun 1, 2020

Should also be fixed on master by 751a1e08904fda197366e4b0033bdfb8b10d256c

Read more comments on GitHub >

github_iconTop Results From Across the Web

Original labels not loading in 3D Slicer after batch inference
Issue faced: Even if the original labels are present in the images/labels/original directory, I dont see the label being loaded in 3D slicer...
Read more >
Why Your Labels Aren't Sticking And How to Fix It [Video]
There are a variety of reasons that can explain why your labels aren't sticking, such as wrong label adhesive, temperature, and application ......
Read more >
Labels/Tags not loading Form Recognizer - Microsoft Q&A
Hello, I have a problem with my Form Recognizer. I can't add any of tags/labels because spinner is spinning all the time and...
Read more >
Value labels not working - Forums - IBM Support
I generated a frequency data set with 16 variables. I have entered value labels but I am not able to: 1. toggle to...
Read more >
How to load a label roll in a DYMO LabelWriter - YouTube
This video was created by the DYMO helpdesk representatives to help you out. We hope you find it helpful! If you have questions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found