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.

can't import TFBertModel from transformers

See original GitHub issue

this is the log when I imported the TFBertModel from transformers

from transformers import TFBertModel
ImportError: cannot import name 'TFBertModel' from 'transformers' (/home/cally/.local/lib/python3.7/site-packages/transformers/__init__.py)

my enviroment is transformers 2.4 linux python 3.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
LysandreJikcommented, Apr 1, 2020

That’s because you don’t have TensorFlow 2 installed.

2reactions
mzackariacommented, Feb 24, 2021

You might want to try this:

conda install -c huggingface transformers

(ref: https://pypi.org/project/transformers/)

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot import name 'TFBertModel' from 'transformers ...
I'm trying to use a tensorflow model with huggingface transformers. No success so far... Any hint would be appreciated !
Read more >
Importing TFDebertaModel - Beginners - Hugging Face Forums
However, when I try to import it using the line below, ... ImportError: cannot import name 'TFDebertaModel' from 'transformers' (unknown ...
Read more >
HuggingFace TFBertModel - Kaggle
!pip install transformers import transformers. Requirement already satisfied: transformers in /opt/conda/lib/python3.7/site-packages (2.9.0) Requirement ...
Read more >
cannot import name 'TFAutoModel' from 'transformers'
ImportError: cannot import name 'TFAutoModel' from 'transformers'. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On May 29, ...
Read more >
Issue with transformer version 2.11.0 with pip3 install rasa ...
This installs transformers version 2.11.0. When I run rasa run actions , I get this error. ImportError: cannot import name ...
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