2

What is this error exactly and how do I solve this?
Running the latest version of TensorFlow and Keras


TypeError                                 Traceback (most recent call last)
<ipython-input-2-ffa5ea4a7bf5> in <module>
     26 
     27 import imblearn
---> 28 from imblearn.keras import balanced_batch_generator as bbg
     29 from imblearn.over_sampling import RandomOverSampler as ros
     30 import matplotlib.pyplot as plt

~\anaconda3\lib\site-packages\imblearn\keras\__init__.py in <module>
      2 in keras."""
      3 
----> 4 from ._generator import BalancedBatchGenerator
      5 from ._generator import balanced_batch_generator
      6 

~\anaconda3\lib\site-packages\imblearn\keras\_generator.py in <module>
     55 
     56 
---> 57 class BalancedBatchGenerator(*ParentClass):
     58     """Create balanced batches when training a keras model.
     59 

TypeError: duplicate base class Sequence
Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34
Neel Save
  • 21
  • 3

1 Answers1

0

I had the same problem, I subsequently posted on Imbalanced Learn's GitHub page when I saw that this was unresolved. Thought I would come back to give you the answer from here.

TL;DR of the link:

  • "The root of the problem is that you have a separate installation of keras."
  • "So, as a workaround uninstalling the keras module itself and import it from tensorflow directly will solve your problem."