Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug - update 'deeplab.py' #180 #181 #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samscientist
Copy link

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.

  • Python 3.12.4
  • tensorflow==2.17.0
  • pixellib==0.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant