Upasana Mittal
Upasana Mittal

Reputation: 2680

How to name keras model based on functional api

I know how to set name of keras model when used sequential but I don't know how to name a functional api based model. Let me re-phrase, I am asking how to set name of a keras model not the layer


Solved

Well I experimented a little and it worked, so to name functional api based keras model, just pass the input in Model as follows:

Model(inputs=inputs, outputs=dense_out, name=name)

Upvotes: 6

Views: 2810

Answers (1)

Upasana Mittal
Upasana Mittal

Reputation: 2680

Well I experimented a little and it worked, so to name functional api based keras model, just pass the input in Model as follows:

Model(inputs=inputs, outputs=dense_out, name=name)

and its name can be excessed in similar way we access sequential one i.e.

model.name

Naming models comes in handy when you are working with bunch of models and want to save them all as well.

Upvotes: 5

Related Questions