ImportError: cannot import name 'ElectraForMaskedLM'
See original GitHub issueDescribe the bug
ImportError Traceback (most recent call last)
<ipython-input-21-c3e03203b6fb> in <module>
----> 1 from simpletransformers.classification import MultiLabelClassificationModel
/opt/conda/lib/python3.6/site-packages/simpletransformers/classification/__init__.py in <module>
1 from simpletransformers.classification.classification_model import ClassificationModel
----> 2 from simpletransformers.classification.multi_label_classification_model import MultiLabelClassificationModel
3 from simpletransformers.classification.multi_modal_classification_model import MultiModalClassificationModel
/opt/conda/lib/python3.6/site-packages/simpletransformers/classification/multi_label_classification_model.py in <module>
6
7 from simpletransformers.classification import ClassificationModel
----> 8 from simpletransformers.custom_models.models import (
9 BertForMultiLabelSequenceClassification,
10 RobertaForMultiLabelSequenceClassification,
/opt/conda/lib/python3.6/site-packages/simpletransformers/custom_models/models.py in <module>
12 from transformers import FlaubertModel
13 from transformers.configuration_xlm_roberta import XLMRobertaConfig
---> 14 from transformers import ElectraForMaskedLM, ElectraForPreTraining
15 from torch.nn import BCEWithLogitsLoss
16
ImportError: cannot import name 'ElectraForMaskedLM'
To Reproduce
from simpletransformers.classification import MultiLabelClassificationModel
Expected behavior Successful Import
Desktop (please complete the following information):
- Ubuntu 16.04
- simpletransformers-0.24.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
ImportError: cannot import name 'LayoutLMv3Processor' from ...
I am getting following error in huggingface sagemaker. ImportError: cannot import name 'LayoutLMv3Processor' from 'transformers' ...
Read more >How to resolve the hugging face error ImportError: cannot ...
I was trying to use the ViTT transfomer. I got the following error with code: from pathlib import Path import torchvision from typing...
Read more >How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >ImportError: cannot import name 'dtensor' - Jetson Nano
Hello Guys, I just got a Jetson Nano and created my SD-Card with Jetpack 4.6.1. After that I installed TensorFlow like this: ...
Read more >ImportError: cannot import name 'PetroskiSuchModel'
the following configuration is deepchem=2.4.0 rc ,tensorfow :2.3.0 python :3.6.5,rkdit:2020.09.1.0,why ?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
pip install --upgrade transformers
You need to update transformers as well, not just simpletransformers.