The on-disk format of the model.json file.

TF.js 1.0 always populates the optional fields when writing model.json. Prior versions did not provide those fields.

interface ModelJSON {
    convertedBy?: null | string;
    format?: string;
    generatedBy?: string;
    initializerSignature?: {};
    modelInitializer?: {};
    modelTopology: {};
    signature?: {};
    trainingConfig?: TrainingConfig;
    userDefinedMetadata?: { [key: string]: {} };
    weightsManifest: WeightsManifestConfig;
}

Properties

convertedBy?: null | string

What library or tool is responsible for converting the original model to this format, applicable only if the model is output by a converter.

Used for debugging purposes. E.g., 'TensorFlow.js Converter v1.0.0'.

A value of null means the model artifacts are generated without any conversion process (e.g., saved directly from a TensorFlow.js tf.LayersModel instance.)

format?: string

Hard-coded format name for models saved from TensorFlow.js or converted by TensorFlow.js Converter.

generatedBy?: string

What library is responsible for originally generating this artifact.

Used for debugging purposes. E.g., 'TensorFlow.js v1.0.0'.

initializerSignature?: {}

Inputs and outputs signature for model initializer.

modelInitializer?: {}

Initializer for the model.

modelTopology: {}

Model topology.

For Keras-style tf.Models, this is a JSON object. For TensorFlow-style models (e.g., SavedModel), this is the JSON encoding of the GraphDef protocol buffer.

signature?: {}

Inputs and outputs signature for saved model.

trainingConfig?: TrainingConfig

Model training configuration.

userDefinedMetadata?: { [key: string]: {} }

User-defined metadata about the model.

weightsManifest: WeightsManifestConfig

Weights manifest.

The weights manifest consists of an ordered list of weight-manifest groups. Each weight-manifest group consists of a number of weight values stored in a number of paths. See the documentation of WeightsManifestConfig for more details.