ageron / ageron/handson-ml2

Chapter 11 : Reusing a Keras model

Ouverte
#143 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
30k
Forks
13.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi @ageron

I am getting an error " ValueError: The name "dense" is used 2 times in the model. All layer names should be unique." with the last line in Cell 60.

>
> **Cell 60:
> .....
> model_B_on_A.add(keras.layers.Dense(1, activation="sigmoid"))**
>

Just to rule out any errors from my side, I copied the code from the Note book from github, still receiving the same error. I even tried restarting the kernal as well as issuing a keras.backend.clear_session(). But no success.

So, I added a customized name for the time being to move forward as below:
model_B_on_A.add(keras.layers.Dense(1, name = "dense_final", activation="sigmoid"))

My environment:
tensorflow 2.0.0,
keras 2.2.4-tf
Python 3.7.6

Not sure whether I did some thing wrong to get the above error or does it need the 'name' parameter for the last layer to remove ambiguity.

Thanks
Satya

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.