segmentation_models icon indicating copy to clipboard operation
segmentation_models copied to clipboard

module 'keras.utils.generic_utils' has no attribute 'get_custom_objects'

Open Rakshith2202 opened this issue 2 years ago • 4 comments
trafficstars

This is the error I am getting when I am trying to import segmentation_models

Rakshith2202 avatar Jun 15 '23 06:06 Rakshith2202

Try to add

import os
os.environ['SM_FRAMEWORK'] = 'tf.keras'

before importing keras and segmentation_models.

jensleitloff avatar Jul 19 '23 06:07 jensleitloff

Adding on to @jensleitloff 's answer, this answer on StackOverflow provides some more alternate approaches.

The accepted answer worked for me on a local machine and the answer in this thread worked for Kaggle/Colab.

vijay-jaisankar avatar Nov 16 '23 15:11 vijay-jaisankar

this answer helped alot

sohailjamal avatar Dec 06 '23 07:12 sohailjamal

this may help https://github.com/qubvel/segmentation_models/pull/582

idhamari avatar Jan 12 '24 21:01 idhamari