microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities

Home Page:https://aka.ms/GeneralAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

jyotiyadav94 opened this issue · comments

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.

  • Platform:
  • Python version: 3.7
  • PyTorch version (GPU?): Google collab

Any updates on this ?