Giter VIP home page Giter VIP logo

Comments (9)

NielsRogge avatar NielsRogge commented on May 24, 2024 2

Always use 5e-5 to fine-tune Transformer-based models ;)

from transformers-tutorials.

Jerome-Michael avatar Jerome-Michael commented on May 24, 2024 1

thanks for your reply.
I had a balanced dataset . I have solved the issue. The problem was the learning rate . I changed different learning rates and trained for longer epochs and now the model seems to predict different classes.

from transformers-tutorials.

NielsRogge avatar NielsRogge commented on May 24, 2024 1

You can leverage LayoutLMv2FeatureExtractor for LayoutXLM (as the image-related part is the same), however, the tokenizer for LayoutXLM is based on XLM-RoBERTa. So you would have to use the following tokenizer:

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("microsoft/layoutxlm-base")

So you would have to use both the feature extractor and tokenizer separately, there's no processor defined for it, for now.

from transformers-tutorials.

NielsRogge avatar NielsRogge commented on May 24, 2024

The model's training accuracy was above 90% after certain epochs , but it is always predicting the same class.

So you do have a very imbalanced dataset (i.e. a lot more samples of a given class compared to another class)?

from transformers-tutorials.

Jerome-Michael avatar Jerome-Michael commented on May 24, 2024

the issue was solved and closed

from transformers-tutorials.

Jerome-Michael avatar Jerome-Michael commented on May 24, 2024

yes sure ...thanks...

I have another question.

Can you please tell me how to load Layoutlxlm model (multilingual) ?

What is the tokenizer , feature extractor and processor for Layoutxlm ?

from transformers-tutorials.

Jerome-Michael avatar Jerome-Michael commented on May 24, 2024

Thank you for the clear explanation @NielsRogge

from transformers-tutorials.

Laxmi530 avatar Laxmi530 commented on May 24, 2024

Hai @Jerome-Michael
I am also facing the same issue can you please share what learning rate you used and how many classes you have in your dataset and how you balanced the dataset.

Thanking you in advance.

from transformers-tutorials.

Jerome-Michael avatar Jerome-Michael commented on May 24, 2024

Hi @Laxmi530 .
I think I used 1e-5 . I trained for little more epochs around 50. I had 3 classes. totally balanced

from transformers-tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.