qubvel / efficientnet

Implementation of EfficientNet model. Keras and TensorFlow Keras.
https://arxiv.org/abs/1905.11946
Apache License 2.0
2.07k stars 472 forks source link

Cannot use multiple EfficientNetB7 backbones in the same model #122

Open msafi04 opened 4 years ago

msafi04 commented 4 years ago

I am trying to use 3 'EfficientNetB7' backbones with different input size in the same model but I get the following error.

Is there a way to change the name of the model name?

I tried model._name to set a new name but didn't work.

Please help

ValueError: The name "efficientnet-b7" is used 2 times in the model. All layer names should be unique.

Smankusors commented 4 years ago

You might want to use solution on here

Altough.... this is not documented and subject to change over time 🤔

nrasadi commented 3 years ago

https://github.com/keras-team/keras/issues/6194#issuecomment-833002993

martin-gorner commented 3 years ago

quick workaround: wrap one of the models in tf.keras.Sequential([model], name="new_name"). That will resolve the naming issue.