image-segmentation-keras
image-segmentation-keras copied to clipboard
module 'keras.utils' has no attribute 'get_file'
hello @divamgupta I WANT to run your network but as soon as I type: model = pspnet_50_ADE_20K() it shows me that error. I'm stucked pls help.
Hey ranch! what version of tensorflow are you running? Do you load in keras separately? What worked for me is downgrading the tensorflow version, and load keras from tensorflow instead of on it's own, so:
from tensorflow import keras
Otherwise, run the code from this post below. It has all the versions of libraries pretty much guaranteed to work together. https://github.com/divamgupta/image-segmentation-keras/issues/305
Hi, I am getting the same error while running the Google Colab (Python) notebook. PFA image.
Hi, I am getting the same error while running the Google Colab (Python) notebook. PFA image.
Same error with me. have you find some solution?
Installing the recommended version of tensorflow (tensorflow 2.4.1) and keras (2.4.3) solved this error for me. I also downgraded to python 3.6.8 on my Windows machine
Just go to the vgg16.py
file and change keras.utils.get_file
to tensorflow.keras.utils.get_file
@sachinkmohan I tried doing this, but I'm still getting the error at line 77, in get_vgg_encoder NameError: name 'keras' is not defined
. I also tried adding from tensorflow import keras
.
I'm using tensorflow 2.3.0 (as I dont have CUDA 11 GPU). I changed keras.
calls to tensorflow.keras
calls wherever applicable, and got the repo working for pre-trained model segmentations. But I'm not able to train.
Kindly help me out.
This is what I did! You can refer this. @varungupta31
https://github.com/sachinkmohan/image-segmentation-keras/pull/4/files
@sachinkmohan Thank you for your inputs. I identified that the error though ending at this trace, was being caused by other issue, also I was running the command from subdir, which caused this issue (my bad).
I had same problem with vgg u-net model , This worked for me
!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
or check here how it's implemented https://gitee.com/sanyanjie/image-segmentation-keras