You can use Keras model.summary() to get the name of the last layer.
If model.outputs is not empty you can get the node names via:
[node.op.name for node in model.outputs]
you get the session via
session = keras.backend.get_session()
and you convert all training variables to consts via
min_graph = convert_variables_to_constants(session, session.graph_def, [node.op.name for node in model.outputs])
after that you can write a protobuf-file via
tensorflow.train.write_graph(min_graph, "/logdir/", "file.pb", as_text=True)