# Error trying to load MarkupLMForPretraining

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-trying-to-load-markuplmforpretraining%2F18720%3E%5C
**Category:** 🤗Transformers\
**Created:** [June 4, 2022, 6:41pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-trying-to-load-markuplmforpretraining%2F18720 "2022-06-04T18:41:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Interogativ](https://avatars.discourse-cdn.com/v4/letter/i/8e8cbc/32.png) [@Interogativ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FInterogativ)%5C
**Post date:** [June 4, 2022, 6:41pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-trying-to-load-markuplmforpretraining%2F18720%2F1 "2022-06-04T18:41:07Z")

</div>

I’m new to HF and just got this error, I’m using transformers version 4.2.0.dev0 and pytorch version 1.11.0 with python3.8.

```auto
ImportError Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 from transformers import MarkupLMForPretraining
      3 model = LayoutLMv2Model.from_pretrained("microsoft/layoutxlm-base")

ImportError: cannot import name 'MarkupLMForPretraining' from 'transformers' (/home/user/miniconda3/envs/fastai6/lib/python3.8/site-packages/transformers/ __init__.py)

```

Is this model restricted? Is it because of my transformers version?

---

<div class="post-metadata">

**Author:** ![Interogativ](https://avatars.discourse-cdn.com/v4/letter/i/8e8cbc/32.png) [@Interogativ](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FInterogativ)%5C
**Post date:** [June 16, 2022, 7:41pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-trying-to-load-markuplmforpretraining%2F18720%2F2 "2022-06-16T19:41:15Z")

</div>

It’s been a while since I posted this, does anyone know why I can’t load this model?

---

<div class="post-metadata">

**Author:** ![cog](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@cog](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcog)%5C
**Post date:** [June 17, 2022, 3:47am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-trying-to-load-markuplmforpretraining%2F18720%2F3 "2022-06-17T03:47:37Z")

</div>

hi

is there ‘MarkupLMForPretraining’ in transformer?

i can’t find at HF docs.

also in the code, you load LayoutLMv2Model but import MarkupLMForPretraining.

regards.
