Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Unknown loss function: categorical_focal_loss_fixed #30

Open
dangmanhtruong1995 opened this issue Nov 15, 2022 · 1 comment

Comments

@dangmanhtruong1995
Copy link

Hi, I was using this library but I got this error when reloading (after successfully training).

File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/saving/save.py", line 206, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects,
File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 199, in load_model_from_hdf5
model.compile(**saving_utils.compile_args_from_training_config(
File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/saving/saving_utils.py", line 218, in compile_args_from_training_config
loss = _deserialize_nested_config(losses.deserialize, loss_config)
File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/saving/saving_utils.py", line 259, in _deserialize_nested_config
return deserialize_fn(config)
File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/losses.py", line 1854, in deserialize
return deserialize_keras_object(
File "/home/THEUSER/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 377, in deserialize_keras_object
raise ValueError(
ValueError: Unknown loss function: categorical_focal_loss_fixed

Do you know how to fix it ? Thanks a lot.

@NIKHILDUGAR
Copy link

Have you copied the losses.py 's functions to your code before calling it? If not then do try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants