ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/
MIT License
1.05k stars 264 forks source link

ImportError: cannot import name 'semantic_segmentation' from 'pixellib.semantic' #163

Open KeryMg opened 1 year ago

gpsub commented 1 year ago

Hi, can you please provide more description. I will try and solve your issue.

iura77 commented 1 year ago

Hi, can you please provide more description. I will try and solve your issue.

I can provide.

the code:

import pixellib
from pixellib.semantic import semantic_segmentation 

the error:

C:\Anaconda3\lib\site-packages\pixellib\semantic\deeplab.py in <module>
     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:\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\__init__.py)
quillaur commented 1 year ago

Same issue.

jeyojey commented 1 year ago

Go to Pixellib folder -> semantic -> deeplab.py and replace this line from tensorflow.python.keras.layers import BatchNormalization with this one from keras.layers.normalization.batch_normalization import BatchNormalization

GraceMinai commented 1 year ago

How can I access this Pixellib folder? I am having the same issue as described above but am afraid I do not know where and how to access the said folder

GraceMinai commented 1 year ago

I got it. Never mind

SunlightWings commented 1 year ago

How did you access the Pixellib folder? @GraceMinai