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 when reloading EfficientNet Model in tf.keras #119

Open
lyndonteng opened this issue Jun 20, 2020 · 0 comments
Open

ValueError when reloading EfficientNet Model in tf.keras #119

lyndonteng opened this issue Jun 20, 2020 · 0 comments

Comments

@lyndonteng
Copy link

While training, tf returned a (non fatal) error indicating that there were multiple overlapping variable names.

Input:

import efficientnet.tfkeras
model = tf.keras.models.load_model(load_model_path, custom_objects={'custom_loss':custom_loss})

Ouptut:

ValueError                                Traceback (most recent call last)
<ipython-input-17-55e7f4d0b56f> in <module>()
      8   model = transfer_model_7x7_14x14(backbone_model, input_shape=input_shape, dims_list=dims_list, num_aspect_ratios=len(aspect_ratios), wt_decay=wt_decay, model_name=model_context+'-res50')
      9 else:
---> 10   model = tf.keras.models.load_model(load_model_path, custom_objects={'custom_loss':custom_loss})
     11 model.summary()

5 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/generic_utils.py in class_and_config_for_serialized_keras_object(config, module_objects, custom_objects, printable_module_name)
    319   cls = get_registered_object(class_name, custom_objects, module_objects)
    320   if cls is None:
--> 321     raise ValueError('Unknown ' + printable_module_name + ': ' + class_name)
    322 
    323   cls_config = config['config']

ValueError: Unknown layer: Functional
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

1 participant