Add Keras metadata proto.
The metadata of each Keras model/layer will be moved from the SavedModel to a separate keras.metadata file. PiperOrigin-RevId: 337394096 Change-Id: Iccba44c8478e038fc9de036313c2e7e88fd5605d
This commit is contained in:
parent
548872a51d
commit
4ad4b488c9
tensorflow/python/keras/protobuf
@ -14,3 +14,10 @@ tf_proto_library(
|
||||
srcs = ["projector_config.proto"],
|
||||
cc_api_version = 2,
|
||||
)
|
||||
|
||||
tf_proto_library(
|
||||
name = "saved_metadata_proto",
|
||||
srcs = ["saved_metadata.proto"],
|
||||
cc_api_version = 2,
|
||||
protodeps = ["//tensorflow/core:protos_all"],
|
||||
)
|
||||
|
33
tensorflow/python/keras/protobuf/saved_metadata.proto
Normal file
33
tensorflow/python/keras/protobuf/saved_metadata.proto
Normal file
@ -0,0 +1,33 @@
|
||||
// Protobuf containing the metadata for each Keras object saved in a SavedModel.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package third_party.tensorflow.python.keras.protobuf;
|
||||
|
||||
import "tensorflow/core/framework/versions.proto";
|
||||
|
||||
message SavedMetadata {
|
||||
// Nodes represent trackable objects in the SavedModel. The data for every
|
||||
// Keras object is stored.
|
||||
repeated SavedObject nodes = 1;
|
||||
}
|
||||
|
||||
// Metadata of an individual Keras object.
|
||||
message SavedObject {
|
||||
// Version defined by the code serializing this Keras object.
|
||||
.tensorflow.VersionDef version = 1;
|
||||
// Index of the node in the SavedModel SavedObjectGraph.
|
||||
int32 node_id = 2;
|
||||
// String path from root (e.g. "root.child_layer")
|
||||
string node_path = 3;
|
||||
|
||||
// Identifier to determine loading function.
|
||||
// Currently supported identifiers:
|
||||
// _tf_keras_layer, _tf_keras_input_layer, _tf_keras_rnn_layer,
|
||||
// _tf_keras_metric, _tf_keras_network, _tf_keras_model,
|
||||
// _tf_keras_sequential
|
||||
string identifier = 4;
|
||||
// Metadata containing a JSON-serialized object with the non-TensorFlow
|
||||
// attributes for this Keras object.
|
||||
string metadata = 5;
|
||||
}
|
Loading…
Reference in New Issue
Block a user