2.5. Linux Setup

Linux-specific notes for Tiny ML ModelZoo 1.5.0. Ubuntu 20.04 or later (x86_64) is the primary development platform.

2.5.1. System Preparation

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git curl wget

2.5.2. Install Python 3.10

curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv install 3.10.14
pyenv global 3.10.14

If pyenv install fails, install the build libraries it lists (for Ubuntu typically libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev liblzma-dev). You can also use python3.10 from your distribution or the deadsnakes PPA.

2.5.3. Installation

Create a virtual environment, then choose one install path (details in Wheel Installation and Clone Installation):

python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools wheel

# Wheel install (no model changes)
pip install https://software-dl.ti.com/C2000/esd/mcu_ai/wheel/tinyml_modelzoo-1.5.0-py3-none-any.whl

# or clone install (add/change models, get examples and run scripts)
git clone https://github.com/TexasInstruments/tinyml-modelzoo.git
cd tinyml-modelzoo
pip install -e .

2.5.4. Verification

python -c "import tinyml_modelmaker, tinyml_tinyverse, tinyml_torchmodelopt, tinyml_modelzoo; print('OK')"

Then configure the compiler (Environment Variables) and run:

./run_tinyml_modelzoo.sh examples/generic_timeseries_classification/config.yaml

2.5.5. GPU Setup (Optional)

Install the NVIDIA driver for your card (for example sudo apt install nvidia-driver-<version> or the driver from NVIDIA). The pip-installed torch==2.11.0 ships its own CUDA runtime, so a separate CUDA Toolkit install is normally not needed. Verify:

nvidia-smi
python -c "import torch; print(torch.cuda.is_available())"

Enable it in the config with training.num_gpus: 1. The default in the example configs is num_gpus: 0 (CPU).

2.5.6. Shell Configuration

Add your compiler variables to ~/.bashrc so they persist (see Environment Variables).

2.5.7. Troubleshooting

Permission denied on run_tinyml_modelzoo.sh

chmod +x run_tinyml_modelzoo.sh

python: command not found / wrong version

Activate the virtual environment and check python --version.

Slow or interrupted downloads

The toolchain wheels are large (PyTorch). Re-run pip; it resumes from its cache. pip install --verbose ... shows progress.

2.5.8. Next Steps