You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lim-anggun I have read your previous comment on adding the instance_nornalization.py .But I am still getting the error
I have added this line of code as mentioned by you. from FgSegNet.instance_normalization import InstanceNormalization model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization})
Error :
`-----------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-26-69f03b7b76fd> in <module>
4 mdl_path = 'FgSegNet_M/CDnet/models50/baseline/mdl_pedestrians.h5'
5 from FgSegNet.instance_normalization import InstanceNormalization
----> 6 model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization})
7 #from FgSegNet_v2_module.py import loss2, acc2
8 #model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization})
~/anaconda3/envs/p3/lib/python3.6/site-packages/keras/models.py in load_model(filepath, custom_objects, compile)
262 metrics=metrics,
263 loss_weights=loss_weights,
--> 264 sample_weight_mode=sample_weight_mode)
265
266 # Set optimizer weights.
~/anaconda3/envs/p3/lib/python3.6/site-packages/keras/engine/training.py in compile(self, optimizer, loss, metrics, loss_weights, sample_weight_mode, **kwargs)
679 loss_functions = [losses.get(l) for l in loss]
680 else:
--> 681 loss_function = losses.get(loss)
682 loss_functions = [loss_function for _ in range(len(self.outputs))]
683 self.loss_functions = loss_functions
~/anaconda3/envs/p3/lib/python3.6/site-packages/keras/losses.py in get(identifier)
100 if isinstance(identifier, six.string_types):
101 identifier = str(identifier)
--> 102 return deserialize(identifier)
103 elif callable(identifier):
104 return identifier
~/anaconda3/envs/p3/lib/python3.6/site-packages/keras/losses.py in deserialize(name, custom_objects)
92 module_objects=globals(),
93 custom_objects=custom_objects,
---> 94 printable_module_name='loss function')
95
96
~/anaconda3/envs/p3/lib/python3.6/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
157 if fn is None:
158 raise ValueError('Unknown ' + printable_module_name +
--> 159 ':' + function_name)
160 return fn
161 else:
ValueError: Unknown loss function:loss
I would appreciate your advice on this. Thank you.
The text was updated successfully, but these errors were encountered:
@lim-anggun Thank you very much. I made the required corrections. Thanks a ton for your reply.
I had one more question, I tried the pedestrian model but the silhouettes I got are noisy. Does the background has an effect on the extracted silhouettes?
What do you think would be the best approach to extract human silhouettes?
@lim-anggun I have read your previous comment on adding the instance_nornalization.py .But I am still getting the error
I have added this line of code as mentioned by you.
from FgSegNet.instance_normalization import InstanceNormalization model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization})
Error :
I would appreciate your advice on this. Thank you.
The text was updated successfully, but these errors were encountered: