ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

from pixellib.tune_bg import alter_bg errror

gk765 opened this issue · comments

commented

I am getting below error after executing the above command

import pixellib
from pixellib.tune_bg import alter_bg

ImportError Traceback (most recent call last)
C:\Users\GIRISH~1\AppData\Local\Temp/ipykernel_14768/2708208855.py in
1 import pixellib
----> 2 from pixellib.tune_bg import alter_bg

~\anaconda3\lib\site-packages\pixellib\tune_bg_init_.py in
2 import numpy as np
3 from PIL import Image
----> 4 from pixellib.semantic.deeplab import Deeplab_xcep_pascal
5 from pixellib.semantic import obtain_segmentation
6 import cv2

~\anaconda3\lib\site-packages\pixellib\semantic_init_.py in
2 import numpy as np
3 from PIL import Image
----> 4 from .deeplab import Deeplab_xcep_pascal
5 from .deeplab import Deeplab_xcep_ade20k
6 import cv2

~\anaconda3\lib\site-packages\pixellib\semantic\deeplab.py in
13 from tensorflow.python.keras.layers import Add
14 from tensorflow.python.keras.layers import Dropout
---> 15 from tensorflow.python.keras.layers import BatchNormalization
16 from tensorflow.python.keras.layers import Conv2D
17 from tensorflow.python.keras.layers import DepthwiseConv2D

ImportError: cannot import name 'BatchNormalization' from 'tensorflow.python.keras.layers' (C:\Users\GIRISH MAURYA\anaconda3\lib\site-packages\tensorflow\python\keras\layers_init_.py)

Hi!

Had the same challenge but solved by installing an older version of Tensorflow, specifically 2.5.0.