Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

'DistilBertConfig' has no attribute 'pretrained_config_archive_map'[BUG] #606

Open
Naviden opened this issue Aug 17, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Naviden
Copy link

Naviden commented Aug 17, 2020

Description

Running the tc_mnli_transformers notebook, gives me the following error:

AttributeError                            Traceback (most recent call last)
<ipython-input-1-273aaa3f3492> in <module>
     19 #!pip install jsonlines
     20 from utils_nlp.common.pytorch_utils import dataloader_from_dataset
---> 21 from utils_nlp.dataset.multinli import load_pandas_df
     22 from utils_nlp.models.transformers.sequence_classification import (
     23     Processor, SequenceClassifier)

~/work/occ_temp/nlp-recipes/utils_nlp/dataset/multinli.py in <module>
     20 from utils_nlp.dataset.url_utils import extract_zip, maybe_download
     21 from utils_nlp.models.transformers.common import MAX_SEQ_LEN
---> 22 from utils_nlp.models.transformers.sequence_classification import Processor
     23 
     24 URL = "http://www.nyu.edu/projects/bowman/multinli/multinli_1.0.zip"

~/work/occ_temp/nlp-recipes/utils_nlp/models/transformers/sequence_classification.py in <module>
     16 supported_models = [
     17     list(x.pretrained_config_archive_map)
---> 18     for x in MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
     19 ]
     20 supported_models = sorted([x for y in supported_models for x in y])

~/work/occ_temp/nlp-recipes/utils_nlp/models/transformers/sequence_classification.py in <listcomp>(.0)
     16 supported_models = [
     17     list(x.pretrained_config_archive_map)
---> 18     for x in MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
     19 ]
     20 supported_models = sorted([x for y in supported_models for x in y])

AttributeError: type object 'DistilBertConfig' has no attribute 'pretrained_config_archive_map'

I tried to downgrade transformers to 2.0.0 with no luck

How do we replicate the bug?

I cloned the repo, copied the notebook in the root ad run it. I also had to install thwe following packages:

  • dask (and its requirements)
  • googledrivedownloader
  • transformers
  • jsonlines

Expected behavior (i.e. solution)

import the libraries without problem

Other Comments

I should say that I'm on CPU machine so I'm not expecting to run the notebook without any problem but this issue seems irrelevant to CPU/GPU

@Naviden Naviden added the bug Something isn't working label Aug 17, 2020
@ashishanand7
Copy link

ashishanand7 commented Dec 7, 2020

Facing Same issue.. can we know the version of transformers being used in the repo ?

Edit : Install transformers==2.6.0 to fix the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants