LogoLogo
  • Tensorleap
  • Examples
    • Semantic Segmentation
    • Image Analysis
    • Sentiment Analysis
    • MNIST Project Walkthrough
    • IMDB Project Walkthrough
  • Quickstart using CLI
  • Guides
    • Full Guides
      • MNIST Guide
        • Dataset Integration
        • Model Integration
        • Model Perception Analysis
        • Advanced Metrics
      • IMDB Guide
        • Dataset Integration
        • Model Integration
        • Model Perception Analysis
        • Advanced Metrics
    • Integration Script
      • Preprocess Function
      • Input Encoder
      • Ground Truth Encoder
      • Metadata Function
      • Visualizer Function
      • Prediction
      • Custom Metrics
      • Custom Loss Function
      • Custom Layers
      • Unlabeled Data
      • Examples
        • CelebA Object Detection (YoloV7)
        • Wikipedia Toxicity (using Tensorflow Datasets)
        • Confusion Matrix
        • CelebA Classification (using GCS)
  • Platform
    • Resources Management
    • Project
    • Dataset
    • Secret Manager
    • Network
      • Dataset Node
      • Layers
      • Loss and Optimizer
      • Visualizers
      • Import Model
      • Metrics
    • Evaluate / Train Model
    • Metrics Dashboard
    • Versions
    • Issues
    • Tests
    • Analysis
      • helpers
        • detection
          • YOLO
    • Team management
    • Insights
  • API
    • code_loader
      • leap_binder
        • add_custom_metric
        • set_preprocess
        • set_unlabeled_data_preprocess
        • set_input
        • set_ground_truth
        • set_metadata
        • add_prediction
        • add_custom_loss
        • set_visualizer
      • enums
        • DatasetMetadataType
        • LeapDataType
      • datasetclasses
        • PreprocessResponse
      • visualizer_classes
        • LeapImage
        • LeapImageWithBBox
        • LeapGraph
        • LeapText
        • LeapHorizontalBar
        • LeapImageMask
        • LeapTextMask
  • Tips & Tricks
    • Import External Code
  • Legal
    • Terms of Use
    • Privacy Policy
Powered by GitBook
On this page
  • Versions Layout Overview
  • Save a Version
  • Export a Model
  • Export Formats

Was this helpful?

  1. Platform

Versions

Save versions and models, run analysis results, and export models out of Tensorleap

PreviousMetrics DashboardNextIssues

Last updated 2 years ago

Was this helpful?

The Versions view is where you track all the saved versions and models of your project. From here, you can and .

Versions Layout Overview

Click on the top left to open the Versions view. Once open, you can choose to fix the view by clicking .

The Versions view lists all versions of your project. Expanding each version shows a list of its related models.

To view the analysis results for a model, toggle the buttons to the left of the model. The stars to the right of the buttons light up, indicating the results are running.

Things to keep in mind when working with versions and models:

  • Models are saved under versions. You need to expand a version to see the models under that version.

The demo video below shows the results of the analysis performed on a model.

Save a Version

Once you complete laying out a new network or making changes to an existing one, you can save it as a new version.

To save a network:

  1. On the Versions view, enter a revision name.

  2. Click Save to add the new version to the list in the Versions view.

By default, when you create a new project, Tensorleap also creates the first version within the master branch. If you want to override this initial version, mark the Override Current Version checkbox when saving a network. If not selected, a new version is added.

Export a Model

When training a network, you will be required to name the model (see Evaluate / Train Model). The model appears under the source network, where you can export it out of Tensorleap into a common standard format.

To export a trained model out of Tensorleap:

  1. With the Versions view open, search for the model under your version.

  2. On the Export Model window, select the format in which the model will be saved.

  3. The job appears on the list to the right with status set to Pending. A notification message also appears briefly on your screen.

8. Once Tensorleap completes compiling the file, status is set to Finished.

If status is still set to Pending after some time, you may need to refresh the page to see the change in status to Finished.

Export Formats

JSON_TF2 - JSON format (TensorFlow 2)

The JSON format serializes the model layers, their properties and connectivity. It does not hold the state (weights) of the model.

Below is a code snippet for loading the exported JSON file:

import tensorflow as tf

json_data = open('exported_model.json').read()
model = tf.keras.models.model_from_json(json_data)

H5_TF2 - H5 format (TensorFlow 2)

The h5 format serializes the model and model state (weights) as a single h5 file.

Below is a code snippet for loading the exported h5 file:

import tensorflow as tf

model = tf.keras.models.load_model('exported_model.h5')

ONNX format (PyTorch)

The onnx format is commonly used in PyTorch for serializing the model's layers and state (weights).

Below is a code snippet for loading the exported onnx file in PyTorch:

import onnx

# Load the ONNX model
model = onnx.load("exported_model.onnx")

SavedModel_TF2 - SaveModel serialization (TensorFlow 2)

This format uses the TensorFlow 2 SaveModel format, and exports a folder with files containing the serialized model layers and state.

The serialized data is stored to a folder with this directory structure:

assets/ (folder)
variables/ (folder)
saved_model.pb

When downloading the SaveModel format from Tensorleap, the exported folder is contained within a compressed .gz file.

To load the exported model, you must extract the .gz file into a folder. One way to do it is by using tar:

tar -xf exported_model.tar.gz

Below is a code snippet to load the model from the extracted folder:

import tensorflow as tf

extracted_model_path = '/path/to/extracted_model'
model = tf.keras.models.load_model(extracted_model_path)

You can save a version of a network after creating a new or editing an existing one (see ).

To start or continue training a specific version, position your cursor over that version, click on the right. (see ).

You can export a model out of Tensorleap into a common standard format (see ).

Click on the left side of the Network view.

Hover your mouse on the model, then click on the right to open the Export Model window.

Click to start the export process.

9. Click to save the file to your computer.

More info at .

More info at .

More info at .

More info at .

https://www.tensorflow.org/api_docs/python/tf/keras/models/model_from_json
https://www.tensorflow.org/tutorials/keras/save_and_load
https://pytorch.org/docs/stable/onnx.html
https://www.tensorflow.org/api_docs/python/tf/keras/models/save_model
Save a Version
Export a Model
Evaluate / Train Model
save versions
export models
The Versions view is on the left
master version Models
Select a model and show analysis
Saving a new version
Models of each Version
Exporting a model
Downloading an exported model