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 ClassificationModel in Kaggle

See original GitHub issue

Can’t import ClassificationModel in the private notebook in Kaggle (Python 3.7). I start:

!pip install simpletransformers import torch from simpletransformers.classification import ClassificationModel

and get the error on the last command:

ImportError: cannot import name ‘MobileBertConfig’ from ‘transformers’ (/opt/conda/lib/python3.7/site-packages/transformers/init.py)

I tried changing parameter “Environment” = “original environment (2020-07-06)” or “latest environment” - no difference

How to fix it?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vin2015-edemcommented, Jul 11, 2020

I solved the problem with a lack of space by switching from model “BERT” to “DistilBERT”. And this gave a very good result even in 1 or 2 epochs. I made public my notebook - you can see: https://www.kaggle.com/vbmokin/nlp-with-dt-simple-transformers-research This is not a prize contest - this is a contest to test new NLP technologies - https://www.kaggle.com/c/nlp-getting-started Thank you for your amazing library and for your help in using it! Your advice “upgrade transformers” helped me.

0reactions
ThilinaRajapaksecommented, Jul 11, 2020

The same issue here. After removing MobileBertConfig and related MobileBert lines, it worked.

It shouldn’t be necessary to remove them if your transformers version is up to date.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't import a dataset I have downloaded from kaggle in a ...
I can't import a dataset I have downloaded from kaggle in a Jupyter Notebook. arrow_drop_up 0. Hey Data scientists!! Here is where I...
Read more >
SVM Classifier Tutorial | Kaggle
I will start off by importing the required Python libraries. ... Based on the above analysis we can conclude that our classification model...
Read more >
Logistic Regression Classifier Tutorial - Kaggle
I train a binary classification model using Logistic Regression. ... pd.read_csv) import matplotlib.pyplot as plt # data visualization import seaborn as sns ...
Read more >
Student's Performance and Classification Model - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from Students Performance in Exams.
Read more >
Bias and Variance in Machine Learning | Kaggle
The irreducible error cannot be reduced regardless of what algorithm is used. ... Importing required Libraries import numpy as np # linear algebra...
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