question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'WEIGHTS_NAME' from 'pytorch_pretrained_bert.file_utils'

See original GitHub issue

I just tried to run run_squad.py example and I got this error:

Traceback (most recent call last):
  File "run_squad.py", line 37, in <module>
    from pytorch_pretrained_bert.file_utils import PYTORCH_PRETRAINED_BERT_CACHE, WEIGHTS_NAME, CONFIG_NAME
ImportError: cannot import name 'WEIGHTS_NAME' from 'pytorch_pretrained_bert.file_utils' (/mnt/Data/miniconda3/lib/python3.7/site-packages/pytorch_pretrained_bert/file_utils.py)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ahmetgunduzcommented, Apr 23, 2019

Same is happening for run_classifier.py

2reactions
thomwolfcommented, Apr 23, 2019

Yes the examples currently require to install from source (see the section in the readme). I’ll release a new version tomorrow so the pip release will be in sync with master examples again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to import BERT model with all packages - Stack Overflow
I am facing the below error. ImportError: cannot import name '_LazyModule' from 'transformers.file_utils' (/usr/local/lib/python3.7/dist- ...
Read more >
pytorch-pretrained-bert - PyPI
This package comprises the following classes that can be imported in Python and are detailed in the Doc section of this readme: Eight...
Read more >
How to resolve the hugging face error ImportError: cannot ...
I got the following error with code: from pathlib import Path import ... import is_tokenizers_available ImportError: cannot import name ...
Read more >
How to Fix : “ImportError: Cannot import name X” in Python
The import error might occur in numerous cases and scenarios. ... In Python "ImportError: cannot import name" error generally occurs when the imported...
Read more >
发布 · mirrors / huggingface / pytorch-pretrained-bert - GitCode
Module by @michaelbenayoun in #18457; Update no trainer scripts for ... TF: correct TFBart embeddings weights name when load_weight_prefix is passed by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found