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 with pytorch-pretrained-bert==0.6.1 and script

See original GitHub issue

Might be due to the fact that we are synced with github source repo but pypi is not updated yet (my current config is pytorch-pretrained-bert==0.6.1).

ImportError                               Traceback (most recent call last)
<ipython-input-5-be760d1df3ec> in <module>()
      1 from cdqa.utils.converter import generate_squad_examples
      2 from cdqa.retriever.tfidf_doc_ranker import predict_document_retriever
----> 3 from cdqa.reader.bertqa_sklearn import BertProcessor, BertQA

~/cdQA/cdqa/reader/bertqa_sklearn.py in <module>()
     35 from tqdm.autonotebook import tqdm, trange
     36 
---> 37 from pytorch_pretrained_bert.file_utils import PYTORCH_PRETRAINED_BERT_CACHE, WEIGHTS_NAME, CONFIG_NAME
     38 from pytorch_pretrained_bert.modeling import BertForQuestionAnswering, BertConfig
     39 from pytorch_pretrained_bert.optimization import BertAdam, warmup_linear

ImportError: cannot import name 'WEIGHTS_NAME'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
fmikaeliancommented, Apr 23, 2019

Ok perfect. It seems HF will release their update tomorrow so this should be resolved. See: https://github.com/huggingface/pytorch-pretrained-BERT/issues/523

However this may happen again and in this case we better build the HF repo from source as you did.

1reaction
andrelmfariascommented, Apr 23, 2019

Yes, I did a git pull from develop branch this morning

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'warmup_linear'
The version 0.4.0 doesn't give this issue. pip install pytorch_pretrained_bert==0.4.0 or downgrading to 0.6.1 solved it.
Read more >
Source code for transformers.modeling_gpt2 - Hugging Face
error("Loading a TensorFlow model in PyTorch, requires TensorFlow to be installed. Please see " "https://www.tensorflow.org/install/ for installation ...
Read more >
natural-language-processing/pytorch-pretrained-BERT - Gitee
print("This script will loop over the available data, but training diversity may be negatively impacted.") num_data_epochs = i. break. else: num_data_epochs ...
Read more >
How to load the pre-trained BERT model from local/colab ...
@ Astariul im getting ImportError:. I want to train the bert masked language model on custom corpus ,i followed the step shared in...
Read more >
pytorch get_linear_schedule_with_warmup - You.com | The AI ...
[ x] the official example scripts: (give details) ... ImportError: cannot import name 'getlinearschedulewithwarmup' ... Created almost 6 years ago.
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