change the Model: given automatically by keras in model.summary() output

后端 未结 2 1958
灰色年华
灰色年华 2021-01-21 17:35

When calling the command:

print(model.summary())

I get the following output:

How can I rena

2条回答
  •  醉酒成梦
    2021-01-21 17:59

    there is the argument 'name'

    in functional format

    inp = Input((10,))
    out = Dense(1)(inp)
    
    m = Model(inp, out, name='model_XXX')
    m.summary()
    

    in sequential format

    m = Sequential([Dense(1, input_dim=10)], name='model_XXX')
    m.summary()
    

    if u have a pre-trained model you can simply do

    m.fit(...)
    m._name = 'model_XXX' # try with m.name if it raise error due to TF version
    m.summary()
    

提交回复
热议问题