microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
20.2k stars 2.55k forks source link

Traceback (most recent call last): File "unilm/layoutlm/examples/seq_labeling/run_seq_labeling.py", line 52, in <module> from layoutlm import FunsdDataset, LayoutlmConfig, LayoutlmForTokenClassification ImportError: cannot import name 'LayoutlmConfig' from 'layoutlm' (/usr/local/lib/python3.7/dist-packages/layoutlm/__init__.py) #742

Closed jyotiyadav94 closed 2 years ago

jyotiyadav94 commented 2 years ago

Describe the bug Model I am using (UniLM,LayoutLM)

The problem arises when I run the below code for making prediction ! python unilm/layoutlm/examples/seq_labeling/run_seq_labeling.py --do_predict \ --data_dir data \ --model_type layoutlm \ --model_name_or_path output \ --output_dir output \ --labels data/labels.txt \ --fp16

Error Traceback (most recent call last): File "unilm/layoutlm/examples/seq_labeling/run_seq_labeling.py", line 52, in from layoutlm import FunsdDataset, LayoutlmConfig, LayoutlmForTokenClassification ImportError: cannot import name 'LayoutlmConfig' from 'layoutlm' (/usr/local/lib/python3.7/dist-packages/layoutlm/init.py)

To Reproduce Steps to reproduce the behavior: I run the below notebook

image

Tried:

Expected behavior LayoutLM_model.zip

A clear and concise description of what you expected to happen.

jyotiyadav94 commented 2 years ago

Any updates on this ?

qiujiu123 commented 7 months ago

how do you reslove the problem?