Microsoft LayoutLM model error with huggingface

632 views Asked by At

I was trying to utilize the https://github.com/microsoft/unilm/tree/master/layoutlm for document classification purpose, but was constantly getting "OSError: Unable to load weights from pytorch checkpoint file."

Can someone help me to run and work with layoutLM.

Configuration/Versions:

  • Windows 10
  • Python - 3.6.5
  • huggingface-transformers - 3.1.0
  • pytorch - 1.5.0
  • tensorflow - 2.3.1

command to run the code:

python run_classification.py --data_dir C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\data --model_type layoutlm --output_dir C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\data --do_eval --model_name_or_path

I believe there are some issues with the command --model_name_or_path, I have tried the above method and tried downloading the pytorch_model.bin file for layoutlm and specifying it as an argument for --model_name_or_path, but of no help. C:\Users\Downloads\unilm-master\unilm-master\layoutlm\examples\classification\model\pytorch_model.bin.

And also I doubt if it is because of the discrepancy between Transformer's support and layoutlm support (related to the version of tranformers 3.1.0 or 2.0.0)?

Can someone help me get up to speed with layoutLM.

Help is appreciated.

0

There are 0 answers