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 whe
For changing names of model.layers with tf.keras you can use the following lines:
for layer in model.layers:
layer._name = layer.name + str("_2")
I needed this in a two-input model case and ran into the "AttributeError: can't set attribute", too. The thing is that there is an underlying hidden attribute _name, which causes the conflict.