Keras rename model and layers
To rename a keras model in TF2.2.0:
model._name = "newname"
I have no idea if this is a bad idea - they don't seem to want you to do it, but it does work. To confirm, call model.summary() and you should see the new name.
1) I try to rename a model and the layers in Keras with TF backend, since I am using multiple models in one script.
Class Model seem to have the property model.name, but when changing it I get "AttributeError: can't set attribute".
What is the Problem here?
2) Additionally, I am using sequential API and I want to give a name to layers, which seems to be possibile with Functional API, but I found no solution for sequential API. Does anonye know how to do it for sequential API?
UPDATE TO 2): Naming the layers works, although it seems to be not documented. Just add the argument name, e.g. model.add(Dense(...,...,name="hiddenLayer1"). Watch out, Layers with same name share weights!