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
  • Prerequisites
  • Installing Leap CLI
  • Leap Init
  • Leap Login
  • Dataset Integration
  • Model Integration
  • Validation
  • Synchronization
  • What's Next?

Was this helpful?

Quickstart using CLI

Prerequisites

Prior steps are logging in, creating a project and a dataset instance.

More info about these steps is described at the Setup page.

Installing Leap CLI

Install leapcli using the following command:

pip install leapcli

Once installed successfully, the leap command shall be available.

Leap Init

Once the leap CLI is installed, you can initialize your project to be synced with the Tensorleap platform.

In the target project path, run the following command to initialize Tensorleap within the project:

leap init PROJECT_NAME DATASET_NAME

Replace the arguments with the corresponding value:

Args

PROJECT_NAME

The name of the project

DATASET_NAME

All the parameters are stored at the .tensorleap/config.toml file and could be changed if needed.

Leap Login

In order to access the platform, we must run the leap login command within the initialized project path, as such:

leap login [API_ID] [API_KEY] [ORIGIN]

Dataset Integration

The script should be set at the .tensorleap/dataset.py file.

Important to note that this script should be contained and not use external project dependencies!

More info can be found at the Dataset Script page. A sample script can be found at the MNIST Guide.

Model Integration

The model integration script is located at .tensorleap/model.py, an example script below:

from pathlib import Path
from myproject.model import build_model # import from the parent project

def leap_save_model(target_file_path: Path):
    # Load your model
    model = build_model()
    # Save it to the path supplied as an arugment (has a .h5 suffix)
    model.save(target_file_path)

Coming Soon

The leap_save_model is automatically called by the CLI when pushing a model into the Tensorleap platform. Its purpose is to prepare and store the model in the provided target_file_path.

More info can be found at the Dataset Script page. A sample script can be found at the MNIST Guide.

Validation

You can validate the dataset and model scripts locally by using the following command:

leap check --all

This command will validate the scripts together with its synchronization with the Tensorleap platform.

Synchronization

Once everything is validated, you can push the dataset script and model to the Tensorleap platform for further evaluation/training/analysis.

To push the dataset script, use the following command from the project path:

leap push --dataset

To push the model to the project, use the following command:

leap push --model

You can also set the branch-name, description and model-name as such:

leap push --model [--branch-name=<BRANCH_NAME> [--description=<DESCRIPTION>] 
          [--model-name=<MODEL_NAME>]

What's Next?

You can follow the next steps to prepare the model for analysis:

  • The model is ready for training or evaluation:

  • After the process is done, the model is ready for analysis. More info at Analysis.

PreviousIMDB Project WalkthroughNextGuides

Last updated 2 years ago

Was this helpful?

The name of the

The API_ID , API_KEY and the ORIGIN, along with the full command, can easily be found by clicking the button within the view.

For Tensorleap to read the data and fetch it to the model for training or evaluation, we must provide a . This script defines the preprocessing function, input/ground_truth encoders and metadata functions.

This script will later be synced with the set by the DATASET_NAME property above.

Additional examples can be found at the repository.

Additional examples can be found at the repository.

You can now log in into the Tensorleap Platform within the UI, and find the imported model within the project, and the dataset within the view.

Open up the current project (defined by the PROJECT_NAME above). More info at .

Find the imported model on the Versions view, hover your cursor over the view and click on the right to Open Commit.

Back on the Network view, set the to point to the DATASET_NAME Dataset Instance, and connect it to the first layer.

Add the ground truth, loss and optimizer blocks, and connect them to the end of the network. More info at and .

Save the version model by clicking the button and set the Revision Name . This adds the new version to the view. More info at .

Already trained model - click from the top bar to inference the data and collect metrics. Re-train / train from scratch in the Tensorleap platform - click from the top bar to train the model. More info at Evaluate / Train Model.

Tensorleap Examples
Tensorleap Examples
Resources Management
Resources Management
Loss and Optimizer
Versions
Open a Project
Dataset Script
Dataset Instance
Dataset Instance
Dataset Block
Dataset Block Setup
Save a Version