image-segmentation-keras
image-segmentation-keras copied to clipboard
Can't Use Any Model Except fcn_8
Any time I try to use any model except fcn_8 I get this error:
weights_path = keras.utils.get_file( AttributeError: module 'keras.utils' has no attribute 'get_file'
Any ideas?
Thanks
I have the same issue. Did anyone manage to work around it?
If you download and build locally, before running the setup.py init, set the optional parameter in the get_
This is a work around and disables the "if pretrained: " code block that uses .get_file(). This works for me since we are using these models for completely custom datasets.
I am wondering if this issue has anything to do with the fact that keras was integrated into tensorflow 2.0 in 2019. No idea though.
If you're doing it in the colab example like I am you can navigate to this directory /usr/local/lib/python3.7/dist-packages/keras_segmentation
, make the edit there from what abertonica said, save, then restart the runtime.
Everywhere update
import keras
to import tensorflow.keras
This will solve the issue.
You can also clone this repo and use it image-segmentation-keras
Hello Sushantag9, I cloned your repository. I have my current work directory, I cloned your Keras segmentation and I have a Jupyter notebook. Now I use the model = vgg_unet(n_classes=n_classes,input_height=img_height,input_width=img_width)
gives the error keras.utils has no attribute. But when I run it in Colab everything seems to run
Can you share the full error.
Please install from @sushantag9 's repo replace from tensorflow.keras.layers.merge import Concatenate with from tensorflow.keras.layers import Concatenate it worked for me
Hello, Sushant, I am using the image segmentation for cityscapes pertained models. When I do model.train() , what is mean IoU considered as the metric. I am not able to to understand as it is different from normal the mean IoU. Also how to plot the history of the models.
Just import those
!apt-get install -y libsm6 libxext6 libxrender-dev
!pip install opencv-python
!pip install git+https://github.com/divamgupta/image-segmentation-keras
from keras_segmentation.models.unet import vgg_unet