image-segmentation-keras icon indicating copy to clipboard operation
image-segmentation-keras copied to clipboard

Colab examples not working

Open andrey-bat opened this issue 3 years ago • 5 comments

Colab has upgraded to tensorflow 2.5 and now your examples are broken.

andrey-bat avatar Jun 15 '21 08:06 andrey-bat

For the python example (https://colab.research.google.com/drive/1q_eCYEzKxixpCKH1YDsLnsvgxl92ORcv?usp=sharing), I can run it after changing the first cell from

!pip install git+https://github.com/divamgupta/image-segmentation-keras

to

!pip uninstall tensorflow tensorboard tensorboard-data-server tensorflow-datasets tensorflow-estimator tensorflow-gcs-config tensorflow-hub tensorflow-metadata tensorflow-probability keras keras-nightly Keras-Preprocessing keras-vis -y
!pip install tensorflow==2.4
!pip install git+https://github.com/divamgupta/image-segmentation-keras

This remove all old keras and tensorflow packages and install tensorflow 2.4 back

nonjosh avatar Jun 21 '21 07:06 nonjosh

Hi Nonjosh, just wanted to say your post basically saved my thesis since I else had to run it on my CPU for 4 days straight! thanks!

SjoerdBraaksma avatar Jul 18 '21 09:07 SjoerdBraaksma

I'm still having this issue.

anushka17agarwal avatar Aug 16 '21 04:08 anushka17agarwal

When I make the suggestions that @nonjosh recommended, the following code block fails:

from keras_segmentation.models.unet import vgg_unet
model = vgg_unet(n_classes=50 ,  input_height=320, input_width=640  )

with

---> 36 from tensorflow.python.eager.context import get_config

ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/context.py)

josiahcoad avatar Nov 03 '21 04:11 josiahcoad

Building upon @nonjosh answer, and then also @dippatel1994's answer from #323. I managed to get it all working again in Colab by changing the lines to

! pip uninstall tensorflow tensorboard tensorboard-data-server tensorflow-datasets tensorflow-estimator tensorflow-gcs-config tensorflow-hub tensorflow-metadata tensorflow-probability keras keras-nightly Keras-Preprocessing keras-vis -y
! pip install tensorflow==2.4.1
! pip install keras==2.4.3
! pip install git+https://github.com/divamgupta/image-segmentation-keras

frederikstroem avatar Dec 15 '21 22:12 frederikstroem