2.4. Windows Setup
Windows-specific notes for Tiny ML ModelZoo 1.5.0. Both native Windows and WSL2 work; Linux is the primary development platform.
2.4.1. Native Windows
Install Python 3.10 (see Prerequisites).
Enable long paths in Git (only for the clone install), once per system:
git config --global core.longpaths true
Create a virtual environment and install, using one of the two install paths:
python -m venv venv .\venv\Scripts\Activate.ps1 python -m pip install --upgrade pip setuptools wheel # Wheel install pip install http://software-dl.ti.com/C2000/esd/mcu_ai/wheel/tinyml_modelzoo-1.5.0-py3-none-any.whl # or clone install git clone https://github.com/TexasInstruments/tinyml-modelzoo.git cd tinyml-modelzoo pip install -e .
Set the compiler variable for your device (Environment Variables).
Run the hello world example from the cloned folder:
run_tinyml_modelzoo.bat examples\generic_timeseries_classification\config.yaml
or in PowerShell:
./run_tinyml_modelzoo.ps1 examples/generic_timeseries_classification/config.yaml. With the wheel install, usepython -m tinyml_modelmaker.run_tinyml_modelmaker config.yaml(see Wheel Installation).
ti_mcu_nnc (the compiler) is published for Windows x86_64 on Python 3.10.
2.4.2. WSL2
WSL2 gives a full Linux environment. See the WSL documentation.
wsl --install --web-download --distribution Ubuntu-22.04
Restart when prompted and run the command again to create the UNIX user. Then follow Linux Setup inside the WSL shell.
Tip
Keep project files inside the WSL filesystem (/home/<user>), not on /mnt/c,
for much better performance. Browse WSL files from Windows at \\wsl.localhost\Ubuntu-22.04.
2.4.2.1. Behind a Proxy (WSL)
If apt or pip cannot reach the network, set proxy variables, for example in
/etc/profile.d/proxy.sh:
export http_proxy="http://your.proxy.address:port"
export https_proxy="http://your.proxy.address:port"
export no_proxy="localhost,127.0.0.1"
and Acquire::http::proxy / Acquire::https::proxy in /etc/apt/apt.conf. Run
wsl --shutdown afterwards. If DNS fails, set a nameserver in /etc/resolv.conf and
generateResolvConf = false under [network] in /etc/wsl.conf.
USB devices (such as LaunchPads) can be attached to WSL with usbipd-win.
2.4.3. Common Windows Issues
- Path too long
Enable Git long paths (above) and clone to a short path such as
C:\dev. System-wide: setLongPathsEnabledto 1 inHKLM:\SYSTEM\CurrentControlSet\Control\FileSystem(as Administrator).- Running scripts is disabled
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser- Virtual environment activation fails
Use
.\venv\Scripts\activate.bator call.\venv\Scripts\python.exedirectly.- CUDA GPU
Install the NVIDIA driver, then set
training.num_gpus: 1in the config. Check withpython -c "import torch; print(torch.cuda.is_available())".