2.3. Developer Installation

This guide covers the full installation method for developers who want to customize models, add features, or contribute to Tiny ML Tensorlab.

2.3.1. Overview

Developer installation involves:

  1. Cloning the repository

  2. Creating a Python virtual environment

  3. Installing all components in editable mode

  4. Configuring environment variables

2.3.2. Step 1: Clone the Repository

git clone https://github.com/TexasInstruments/tinyml-tensorlab.git
cd tinyml-tensorlab

2.3.3. Step 2: Set Up Python Environment

Option A: Using setup_all.sh (Linux - Recommended)

The easiest method on Linux:

cd tinyml-modelmaker
./setup_all.sh

This script:

  • Creates a virtual environment using pyenv

  • Installs all dependencies

  • Installs all components in editable mode

Option B: Manual Installation

If the script doesn’t work or you’re on Windows:

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Upgrade pip
pip install --upgrade pip

# Install components in order
cd tinyml-modelmaker
pip install -e .

cd ../tinyml-tinyverse
pip install -e .

cd ../tinyml-modeloptimization/torchmodelopt
pip install -e .

cd ../../tinyml-modelzoo
pip install -e .

2.3.4. Step 3: Verify Installation

Verify all components are installed by importing the packages and checking versions:

import tinyml_modelmaker
import tinyml_tinyverse
import tinyml_torchmodelopt
import tinyml_modelzoo

print(f"TI Tiny ML ModelMaker: {tinyml_modelmaker.__version__}")
print(f"TI Tiny ML Tinyverse: {tinyml_tinyverse.__version__}")
print(f"TI Tiny ML Model Optimization toolkit: {tinyml_torchmodelopt.__version__}")
print(f"TI Tiny ML Model Zoo: {tinyml_modelzoo.__version__}")

If all packages import without errors and versions are displayed, your installation is complete.

2.3.5. Step 4: Configure Environment Variables

Warning

IMPORTANT: Environment Variables Required for Model Compilation

For AI model compilation to work, you MUST set environment variables specific to your target device before running examples.

The variables you need depend on which device you’re targeting:

  • C2000 devices (F28P55, F28P65, etc.): Set C2000_CG_ROOT and C2000WARE_ROOT

  • F29 devices (F29H85X, etc.): Set CG_TOOL_ROOT

  • MSPM0 devices: Set ARM_LLVM_CGT_PATH

  • AM13E devices: Set ARM_LLVM_CGT_PATH

  • AM26x devices: Set ARM_LLVM_CGT_PATH

  • Connectivity devices (CC2755, CC1352, etc.): Set ARM_LLVM_CGT_PATH

See Environment Variables for complete device-specific setup instructions.

Step 5: Run the hello world example:

cd tinyml-modelzoo
./run_tinyml_modelzoo.sh examples/generic_timeseries_classification/config.yaml

2.3.6. Directory Structure After Installation

tinyml-tensorlab/
├── tinyml-modelmaker/
│   ├── tinyml_modelmaker/   # Source code (editable)
│   ├── examples/
│   ├── docs/
│   └── data/                # Created on first run
│       └── projects/        # Training outputs
├── tinyml-tinyverse/
│   └── tinyml_tinyverse/    # Source code (editable)
├── tinyml-modeloptimization/
│   └── torchmodelopt/
│       └── tinyml_torchmodelopt/  # Source code (editable)
├── tinyml-modelzoo/
│   ├── tinyml_modelzoo/     # Source code (editable)
│   └── examples/            # Entry point configs
└── venv/                    # Virtual environment

2.3.7. Updating

Using git_pull_all.sh (Recommended)

The simplest way to keep all repositories up to date:

./git_pull_all.sh

This script pulls the latest changes for all sub-repositories in one step.

Manual Update

Alternatively, update each component manually:

# Update from GitHub
git pull origin main

# Reinstall components if dependencies changed
cd tinyml-modelmaker && pip install -e .
cd ../tinyml-tinyverse && pip install -e .
cd ../tinyml-modeloptimization/torchmodelopt && pip install -e .
cd ../../tinyml-modelzoo && pip install -e .

2.3.8. Common Developer Tasks

Adding a New Model

Edit files in tinyml-modelzoo/tinyml_modelzoo/models/:

# tinyml_modelzoo/models/classification.py
class MY_NEW_MODEL(GenericModelWithSpec):
    ...

Modifying Training Scripts

Edit files in tinyml-tinyverse/tinyml_tinyverse/references/:

# Example: classification training
vim tinyml-tinyverse/tinyml_tinyverse/references/timeseries_classification/train.py

Adding Custom Transforms

Edit files in tinyml-tinyverse/tinyml_tinyverse/common/transforms/.

2.3.9. Troubleshooting

“ModuleNotFoundError” after installation

Ensure you’re in the correct virtual environment:

which python  # Should point to your venv
source venv/bin/activate  # Reactivate if needed

Dependency conflicts

Try reinstalling in a fresh environment:

rm -rf venv
python -m venv venv
source venv/bin/activate
# Reinstall all components

Permission errors on Linux

Make scripts executable:

chmod +x tinyml-modelzoo/run_tinyml_modelzoo.sh
chmod +x tinyml-modelmaker/run_tinyml_modelmaker.sh

2.3.10. Next Steps