segmentation_models icon indicating copy to clipboard operation
segmentation_models copied to clipboard

AttributeError

Open keval2232 opened this issue 3 years ago • 5 comments

Hello I have imported and created unet using below code : - model = Unet(input_shape=(128,128,3),classes=256) but when i run it it gives me error AttributeError: module 'keras.utils' has no attribute 'get_file' so how can i slove it I have tensorflow == 2.6.2 and keras == 2.6.0

keval2232 avatar Jan 30 '22 10:01 keval2232

hi, similar problem here. Any solution?

elliestath avatar Feb 08 '22 17:02 elliestath

I am having the same problem. Also this one: AttributeError: module 'tensorflow' has no attribute 'to_int32'

AttributeError: in user code:

    /home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/keras/engine/training.py:853 train_function  *
        return step_function(self, iterator)
    <ipython-input-6-7788975c3f2b>:4 mean_iou  *
        y_pred_ = tf.to_int32(y_pred > t)

tf 2.6.0 keras 2.6.0

PabloNapan avatar Feb 10 '22 02:02 PabloNapan

Hello I have imported and created unet using below code : - model = Unet(input_shape=(128,128,3),classes=256) but when i run it it gives me error AttributeError: module 'keras.utils' has no attribute 'get_file' so how can i slove it I have tensorflow == 2.6.2 and keras == 2.6.0

Did you get to find any solution? I did

import segmentation_models as sm
sm.set_framework('tf.keras')
sm.framework()

and it solves that specific error, but now it outputs other similar error : AttributeError: module 'tensorflow' has no attribute 'to_int32'

PabloNapan avatar Feb 10 '22 03:02 PabloNapan

actually, I did the same as you and I do not have errors anymore. In which line do you get this error? My problem now is that it doesn't recognize the GPU..

elliestath avatar Feb 10 '22 13:02 elliestath

@keval2232 @elliestath Try:

import segmentation_models as sm

sm.set_framework('tf.keras')

sm.framework()

johnfoxy avatar Mar 11 '22 05:03 johnfoxy