clearml-docs/docs/guides/frameworks/tensorflow/manual_model_upload.md
2021-05-14 02:48:51 +03:00

3.2 KiB

title
Manual Model Upload

The manual_model_upload.py example demonstrates ClearML's tracking of a manually configured model created with TensorFlow, including:

  • Model checkpoints (snapshots)
  • Hyperparameters
  • Output to the console.

When the script runs, it creates an experiment named Model configuration and upload, which is associated with the examples project.

Configure ClearML for model checkpoints (model snapshot) storage in any of the following ways (debug sample storage is different):

Configuration

This example shows two ways to connect a configuration, using the Task.connect_configuration method:

  • Connect a configuration file by providing the file's path. ClearML Server stores a copy of the file.
# Connect a local configuration file
config_file = os.path.join('..', '..', 'reporting', 'data_samples', 'sample.json')
config_file = task.connect_configuration(config_file)
  • Create a configuration dictionary and provide the dictionary.
model_config_dict = {
    'value': 13.37,
    'dict': {'sub_value': 'string', 'sub_integer': 11},
    'list_of_ints': [1, 2, 3, 4],
}
model_config_dict = task.connect_configuration(model_config_dict)

If the configuration changes, ClearML track it.

model_config_dict['new value'] = 10
model_config_dict['value'] *= model_config_dict['new value']

The configuration appears in the experiment's page in the ClearML web UI, under CONFIGURATIONS > CONFIGURATION OBJECTS.

image

The output model's configuration appears in ARTIFACTS > Output Model.

Artifacts

Model artifacts associated with the experiment appear in the info panel of the EXPERIMENTS tab) and in the info panel of the MODELS tab.

The experiment info panel shows model tracking, including the model name and design (in this case, no design was stored).

image

The model info panel contains the model details, including:

  • Model design
  • label enumeration
  • Model URL
  • Framework
  • Snapshot locations.

General model information

image

Label enumeration

Connect a label enumeration dictionary by calling the Task.connect_label_enumeration method.

# store the label enumeration of the training model
labels = {'background': 0, 'cat': 1, 'dog': 2}
task.connect_label_enumeration(labels)

image