Home > OS >  Tensorflow conflict in ImageAI pipeline
Tensorflow conflict in ImageAI pipeline

Time:10-30

As a Python 3.9.7 user, I created an environment which has:tensorflow-gpu==2.6.0, keras==2.6.0 and also using imageai, however, whenever I run the code, I get the error:

File "C:\Users\project-name\.venv\lib\site-packages\imageai\Detection\YOLOv3\models.py"

ImportError: cannot import name 'BatchNormalization' from 'keras.layers.normalization'

I know that this is related to tensorflow 2.0, as this error gets corrected if I write manually:

from tensorflow.keras.layers.normalization import BatchNormalization

But it appears in many other files inside the .venv. How could I possibly solve this error for all the files?

CodePudding user response:

Ok, so what managed to solve the dependency conflict was - after installing all requirements, I updated imageai with:

pip install imageai --upgrade
  • Related