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:
Cloning the repository
Creating a Python virtual environment
Installing all components in editable mode
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 .
# Create virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1
# Upgrade pip
python -m 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:
import tinyml_modelmaker
import tinyml_tinyverse
import tinyml_modelzoo
import tinyml_torchmodelopt
# Check versions
print(f"ModelMaker: {tinyml_modelmaker.__version__}")
print(f"TinyVerse: {tinyml_tinyverse.__version__}")
Run the hello world example:
cd tinyml-modelzoo
./run_tinyml_modelzoo.sh examples/generic_timeseries_classification/config.yaml
cd tinyml-modelzoo
run_tinyml_modelzoo.bat examples\generic_timeseries_classification\config.yaml
2.3.5. 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.6. Updating
To update your local copy:
# 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.7. 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.8. 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.9. Next Steps
Environment Variables - Configure compilation tools
Quickstart - Train your first model
Adding Custom Models - Add custom models