Transformers: ImportError: cannot import name 'DataCollatorForLanguageModeling' in run_language_modeling.py

Created on 22 Apr 2020  路  1Comment  路  Source: huggingface/transformers

馃悰 Bug ImportError: cannot import name 'DataCollatorForLanguageModeling' in run_language_modeling.py

Information

Traceback (most recent call last):
File "transformers/examples/run_language_modeling.py", line 29, in
from transformers import (
ImportError: cannot import name 'DataCollatorForLanguageModeling'

Model I am using (Bert, XLNet ...): roberta, Trying to build the model from scratch using the tutorial.

Language I am using the model on (English, Chinese ...): English

The problem arises when using:

  • [x] the official example scripts: (give details below)
    transformers/examples/run_language_modeling.py
  • [ ] my own modified scripts: (give details below)

The tasks I am working on is:

  • [ ] an official GLUE/SQUaD task: (give the name)
  • [x] my own task or dataset: (give details below)
    My own Data set

To reproduce

Steps to reproduce the behavior:

Follow the tutorial here

Expected behavior

Environment info

  • transformers version: transformers-2.8.0 sacremoses-0.0.41 sentencepiece-0.1.85 tokenizers-0.5.2
  • Platform:
  • Python version: 3.x
  • PyTorch version (GPU?):1.4.0
  • Using GPU in script?: No
  • Using distributed or parallel set-up in script?: None

Most helpful comment

Duplicate of #3893

Please install from source until we release a new version of the library on PyPI

>All comments

Duplicate of #3893

Please install from source until we release a new version of the library on PyPI

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rsanjaykamath picture rsanjaykamath  路  3Comments

alphanlp picture alphanlp  路  3Comments

guanlongtianzi picture guanlongtianzi  路  3Comments

hsajjad picture hsajjad  路  3Comments

delip picture delip  路  3Comments