I'm having a problem when loading a model in keras:
model = load_model('model.h5', custom_objects={'mean_iou': metrics.mean_iou})
As an error I get:
~/anaconda3/envs/idcard/lib/python3.6/site-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile)
417 f = h5dict(filepath, 'r')
418 try:
--> 419 model = _deserialize_model(f, custom_objects, compile)
420 finally:
421 if opened_new_file:
~/anaconda3/envs/idcard/lib/python3.6/site-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile)
249 layer_weights = model_weights_group[name]
250 weight_names = layer_weights['weight_names']
--> 251 if weight_names:
252 filtered_layer_names.append(name)
253
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Does anyone have a clue why I'm getting this error?