2.4. Windows Setup
This guide provides Windows-specific instructions for installing and using Tiny ML Tensorlab.
Note
While Tiny ML Tensorlab works on Windows, Linux is the primary development platform. Some features may have better support on Linux.
2.4.1. Option 1: Native Windows Installation
Step 1: Install Python 3.10
Using pyenv-win (Recommended):
# Run PowerShell as Administrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Install pyenv-win
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"
& "./install-pyenv-win.ps1"
# Restart PowerShell, then:
pyenv install 3.10.14
pyenv global 3.10.14
# Verify
python --version
Step 2: Install Git
Download and install Git from https://git-scm.com/download/win
During installation:
Select “Git from the command line and also from 3rd-party software”
Select “Checkout as-is, commit Unix-style line endings”
Step 3: Clone and Install
# Clone repository
git clone https://github.com/TexasInstruments/tinyml-tensorlab.git
cd tinyml-tensorlab
# Create virtual environment
python -m venv venv
.\venv\Scripts\Activate.ps1
# Install components
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 .
Step 4: Run Example
cd tinyml-modelzoo
run_tinyml_modelzoo.bat examples\generic_timeseries_classification\config.yaml
2.4.2. Option 2: WSL2 (Recommended for Full Compatibility)
Windows Subsystem for Linux provides better compatibility with the toolchain.
See also
Step 1: Install WSL2 with Ubuntu 22.04
Open PowerShell as Administrator (right-click and choose “Run as Administrator”):
wsl --install --web-download --distribution Ubuntu-22.04
Restart your computer when prompted.
Note
The above command performs multiple internal steps. If it errors partway through, simply run the same command again after rebooting. It is safe to run multiple times.
Step 2: Create a UNIX User Account
After the reboot, reopen PowerShell and run the install command once more. This time it will detect that Ubuntu 22.04 is already installed and will launch it, prompting you to create a default UNIX user account:
Please create a default UNIX user account. The username does not need to match your Windows username.
Enter new UNIX username: your_username
New password:
Retype new password:
Choose any username and password you like. These do not need to match your Windows or enterprise credentials.
Accessing Files Between WSL and Windows
From Windows: Open File Explorer and type
\\wsl.localhost\Ubuntu-22.04in the address bar to browse your WSL filesystem.From WSL: Your Windows drives are automatically mounted under
/mnt/. For example, access the C: drive withls /mnt/c/.
Tip
For best performance, keep project files inside the WSL filesystem (e.g., under
your /home/<username> directory) rather than on a Windows-mounted drive.
Step 3: Update System and Install Dependencies
# Update packages
sudo apt update && sudo apt upgrade -y
# Install build tools and other dependencies
sudo apt install -y build-essential git curl
# Install pyenv
curl https://pyenv.run | bash
# Add to ~/.bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install Python 3.10
pyenv install 3.10.14
pyenv global 3.10.14
# Clone and install
git clone https://github.com/TexasInstruments/tinyml-tensorlab.git
cd tinyml-tensorlab/tinyml-modelmaker
./setup_all.sh
Step 4: Run Examples
cd ~/tinyml-tensorlab/tinyml-modelzoo
./run_tinyml_modelzoo.sh examples/generic_timeseries_classification/config.yaml
2.4.2.1. Network and Proxy Configuration in WSL (Optional)
Note
This section is relevant if you are behind a corporate firewall, VPN, or proxy.
If your WSL instance can already reach the internet (e.g., sudo apt update
works), you can skip this.
DNS Configuration
If DNS resolution fails inside WSL, you may need to configure /etc/resolv.conf
manually:
sudo nano /etc/resolv.conf
Add a public DNS nameserver (or your corporate DNS server):
nameserver 8.8.8.8
To prevent WSL from overwriting this file on each startup, edit /etc/wsl.conf:
sudo nano /etc/wsl.conf
Add the following:
[network]
generateResolvConf = false
Then make resolv.conf immutable so it persists:
sudo chattr +i /etc/resolv.conf
APT Proxy Configuration
If apt cannot connect to package repositories, configure a proxy. Replace
your.proxy.address:port with your actual proxy settings:
Create or edit
/etc/apt/apt.conf:Acquire::http::proxy "http://your.proxy.address:port"; Acquire::https::proxy "http://your.proxy.address:port";
Create
/etc/profile.d/proxy.shto set environment-wide proxy variables:export http_proxy="http://your.proxy.address:port" export https_proxy="http://your.proxy.address:port" export no_proxy="localhost,127.0.0.1" export HTTP_PROXY="http://your.proxy.address:port" export HTTPS_PROXY="http://your.proxy.address:port" export NO_PROXY="localhost,127.0.0.1"
Shut down and restart WSL for changes to take effect:
wsl --shutdown
Reopen your WSL terminal and verify with
env | grep -i proxy.
2.4.2.2. Docker in WSL (Optional)
If you prefer to use Docker for an isolated build and run environment, you can install it directly inside WSL:
sudo apt update
sudo apt install -y docker.io
sudo usermod -aG docker ${USER}
sudo systemctl start docker
sudo systemctl enable docker
Log out and log back in for the group change to take effect, then verify:
docker --version
Note
Docker is not required if you are using a Python virtual environment for development. It is an alternative approach, useful when a pre-built Docker image is available.
2.4.2.3. USB Device Access from WSL
To connect USB devices (such as TI LaunchPads) to your WSL instance, you need usbipd-win.
In a Windows PowerShell running as Administrator, install usbipd-win:
winget install --interactive --exact dorssel.usbipd-win
Restart PowerShell after installation.
Follow the Microsoft guide to attach a USB device to WSL: Connect USB devices
2.4.2.4. VS Code with WSL
Visual Studio Code can connect directly to your WSL instance, giving you a full GUI editor for files inside WSL.
Install Visual Studio Code on Windows.
Install the WSL extension (also called “Remote - WSL”) from the VS Code marketplace.
Open a WSL terminal and run:
code .This launches VS Code on Windows, connected to the WSL filesystem.
See also
2.4.3. Path Configuration
Long Path Support (Native Windows)
Enable long path support for deep directory structures:
# Run as Administrator
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Environment Variables
Set up paths for TI tools (if compiling for devices):
# Add to your profile or set in System Properties
$env:C2000_CG_ROOT = "C:\ti\ccs\tools\compiler\ti-cgt-c2000_22.6.1.LTS"
$env:C2000WARE_ROOT = "C:\ti\c2000\C2000Ware_5_03_00_00"
2.4.4. Common Windows Issues
PowerShell Execution Policy
If you get “running scripts is disabled”:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Path Too Long Errors
Clone to a short path (e.g., C:\dev\tensorlab) or enable long paths.
Line Ending Issues
Configure Git to handle line endings:
git config --global core.autocrlf true
Virtual Environment Activation
If venv\Scripts\Activate.ps1 fails:
# Alternative activation
.\venv\Scripts\activate.bat
# Or run Python directly
.\venv\Scripts\python.exe -m tinyml_modelmaker ...
2.4.5. GPU Support on Windows
For CUDA support (useful for NAS):
Install NVIDIA drivers from https://www.nvidia.com/drivers
Install CUDA Toolkit from https://developer.nvidia.com/cuda-downloads
Verify with:
python -c "import torch; print(torch.cuda.is_available())"
2.4.6. WSL2 vs Native Windows Comparison
Feature |
Native Windows |
WSL2 |
|---|---|---|
Setup Complexity |
Moderate |
Higher initially |
Shell Scripts |
Requires .bat files |
Full bash support |
Compilation |
Full support |
Full support |
GPU Support |
Native CUDA |
WSL2 CUDA (newer) |
CCS Integration |
Direct |
Requires file sharing |
Recommended For |
Quick start |
Full development |
2.4.7. Next Steps
Environment Variables - Configure TI compiler paths
Quickstart - Train your first model