Copyright (c) 2021-2024 Antmicro
This repository contains tasks for laboratories for the "Optimization of Neural Network applications for IoT devices" course.
Each of the l<number>_<topic>
directories in the dl_in_iot_course
module contain a separate README with the list of tasks.
Please follow the links to go to the list of tasks:
- Lab 02 - Quantization with TensorFlow Lite
- Lab 03 - Pruning and clustering with TensorFlow Model Optimization Toolkit
- Lab 04 - Introduction to Apache TVM
- Lab 05 - Implementing a TensorFlow Lite delegate
- Lab 06 - Fine-tuning of model and operations in Apache TVM
- Lab 07 - Accelerating ML models on FPGAs with TFLite Micro and CFU Playground
Each README provides instructions on:
- What to do in the tasks
- How to run experiments
- How to prepare the summary
NOTE:
Git LFS tool is required to pull large files, such as models.
Install it before cloning the repository.
To clone the repository with all models, run:
git clone --recursive https://github.com/antmicro/dl-in-iot-course.git
cd dl-in-iot-course/models
git lfs pull
cd ..
The recommended approach is to use a Docker image that provides all dependencies necessary for running tasks from the project.
The definition for the Docker image is located in environments
directory.
To pull the built image, run:
docker pull ghcr.io/antmicro/dl-in-iot-course:latest
To run it and automatically include the current workspace directory, you can run:
docker run -it --rm -v $(pwd):$(pwd) -w $(pwd) ghcr.io/antmicro/dl-in-iot-course:latest /bin/bash
From this point, you can run tasks for the project.
The dependencies for tasks are provided in the requirements.txt
file.
To install them, first create a virtual environment with venv
in project's directory:
python3 -m venv .venv
After this, activate the environment:
source ./.venv/bin/activate
And proceed with installing necessary dependencies:
pip3 install -r requirements.txt
In order to handle Python modules for the project easily, all of the executable scripts should be started from the root of the repository, i.e.:
python3 -m dl_in_iot_course.l02_quantization.quantization_experiments -h