Keras rename model and layers

前端 未结 8 801
情话喂你
情话喂你 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:18

    Just to cover all the options, regarding the title of the question, if you are using the Keras functional API you can define the model and the layers name by:

    inputs = Input(shape=(value, value))
    
    output_layer = Dense(2, activation = 'softmax', name = 'training_output')(dropout_new_training_layer)
    
    model = Model(inputs= inputs, outputs=output_layer, name="my_model")
    

提交回复
热议问题