segmentation_models
segmentation_models copied to clipboard
Unable to load the save model
#i have saved model in metric term of iou_score but when trying to load it up it throw the below error can somebody please guide me how to load the model???
9 frames /tensorflow-1.15.2/python3.7/tensorflow_core/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name) 208 obj = module_objects.get(object_name) 209 if obj is None: --> 210 raise ValueError('Unknown ' + printable_module_name + ':' + object_name) 211 # Classes passed by name are instantiated with no args, functions are 212 # returned as-is.
ValueError: Unknown metric function:iou_score
I haven't tried this but it's very likely the problem is the same as #466. Presumably you need to pass the custom object of iou_score when you load the model.
Dont forget to add this import -> import segmentation_models as sm
'iou_score': sm.metrics.iou_score,
You can close this issue!