With minor tweaks, the semantic segmentation is compatible with recent TensorFlow and Keras.
The PixelLib project seems to be on a halt, but for anyone who steps here, I hope this helps.
The errors I faced were... (every job was held in semantic/deeplab.py)
ImportError: cannot import name '...' from 'tensorflow.python.keras.layers' → change tensorflow.python.keras.layers to tensorflow.keras.layers
ValueError: A KerasTensor cannot be used as input to a TensorFlow function. (on code shape_before = tf.shape(x)) → add Keras Layer subclass and use it to return the shape (x is KerasTensor and shape() is TensorFlow function)
AttributeError: 'KerasHistory' object has no attribute 'layer' → change tensorflow.python.keras.models to tensorflow.keras.models
Additionally, I'm on Apple Silicon with the versions below.
With minor tweaks, the semantic segmentation is compatible with recent TensorFlow and Keras. The PixelLib project seems to be on a halt, but for anyone who steps here, I hope this helps.
The errors I faced were... (every job was held in
semantic/deeplab.py
)ImportError: cannot import name '...' from 'tensorflow.python.keras.layers'
→ change
tensorflow.python.keras.layers
totensorflow.keras.layers
ValueError: A KerasTensor cannot be used as input to a TensorFlow function.
(on code
shape_before = tf.shape(x)
)→ add Keras Layer subclass and use it to return the shape (
x
is KerasTensor andshape()
is TensorFlow function)AttributeError: 'KerasHistory' object has no attribute 'layer'
→ change
tensorflow.python.keras.models
totensorflow.keras.models
Additionally, I'm on Apple Silicon with the versions below.