Keras rename model and layers

前端 未结 8 844
情话喂你
情话喂你 2020-12-31 00:46

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

8条回答
  •  死守一世寂寞
    2020-12-31 01:11

    Detailed answer is here How to rename Pre-Trained model ? ValueError 'Trained Model' is not a valid scope name

    We can use model.name = "Model_Name" when are developing model and making it ready to train. We can also give name to layers. Ex:

    model = Sequential()
    model.name = "My_Model" #Naming model
    model.add(Dense(2,input_shape=(...),name="Name") #Naming layer
    

提交回复
热议问题