Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIVIL-426 | Machine Learning for Predictive Maintenance

EPFL logo            IMOS logo

This repository provides the setup materials for the course Machine Learning for Predictive Maintenance. Its main purpose is to help students configure a standardized programming environment on their personal machines. By following the instructions here, all students will work with the same package versions, dependencies, and tools, ensuring that assignments and projects run smoothly and reproducibly across different systems.

⚠️ NOTE️: Students are strongly encouraged to use the proposed environment. If you decide not to, you are fully responsible for ensuring the reproducibility of your code. No support will be provided during class for debugging dependency issues or Python installation problems outside of the standardized setup.

Table of Contents

Overview

For this course, we use uv as the Python dependency manager. uv is a fast, cross-platform tool that ensures consistent development environments across Windows, macOS, and Linux. By relying on it, we avoid version conflicts and guarantee that assignments and projects behave the same way on all systems.

All Python packages required for the course are specified in this repository, and uv will automatically install them in a clean, isolated virtual environment.

For development, we will use Visual Studio Code as the recommended editor. It integrates smoothly with Python environments created by uv and provides useful features such as linting, debugging, and notebook support.

In summary, the installation process consists of:

  1. Installing uv on your system
  2. Creating the course Python environment using the provided configuration
  3. Opening the project in Visual Studio Code and linking it to the environment

Requirements

Prior to starting the installation process, we recommend that you have the following:

  • Git (strongly recommended): We strongly encourage students to use Git for version control of their code and project files. Version control will help you track changes and recover previous versions of your work if needed. To commit Jupyter notebooks, we recommend committing them with all output cells cleared. This makes it easier to compare different versions of the notebooks and avoids unnecessary clutter in your Git history.

Creating the Python Virtual Environment

macOS Procedure

✅️ NOTE️: The following installation procedure supports hardware acceleration on macOS with Apple Silicon chips using the MPS device. No special steps are required.

  1. Open a terminal.

  2. Install uv using the official instructions:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Restart your terminal (as requested at the end of the installation process).

  2. Install Python 3.10 with uv:

uv python install 3.10
  1. Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025
  1. Navigate inside the cloned repository:
cd MLPM2025
  1. Create the Python virtual environment using uv:
uv sync
  1. Activate the python virtual environment we just created. ⚠️ NOTE: this must be ran everytime you open a new terminal and want to use the MLPM2025 Python environment.
source .venv/bin/activate

Windows Procedure

✅️ NOTE️: The following installation procedure supports hardware acceleration with CUDA 12.4 on Windows if you have an NVIDIA GPU. No special steps are required.

  1. Open a 64-bits Powershell terminal. ⚠️ NOTE: We will always assume that your terminal is a Powershell instance, not a Command Prompt. 🚨 WARNING: Make sure you open a 64-bits Powershell terminal, and not a 32-bits Powershell (x86) terminal.

Notebook output

  1. Install uv using the official instructions:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Restart your terminal (as requested at the end of the installation process).

  2. Install Python 3.10 with uv:

uv python install 3.10
  1. Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025
  1. Navigate inside the cloned repository:
cd MLPM2025
  1. Create the Python virtual environment using uv:
uv sync
  1. Activate the python virtual environment we just created. ⚠️ NOTE️: this must be ran everytime you open a new terminal and want to use the MLPM2025 Python environment.
.venv\Scripts\activate.ps1

Linux Procedure

✅️ NOTE️: The following installation procedure supports hardware acceleration with CUDA 12.4 on Linux if you have an NVIDIA GPU. No special steps are required.

  1. Open a terminal.

  2. Install uv using the official instructions. If you face an error saying that curl is missing, you can install it with sudo apt install curl, or use wget instead.

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Restart your terminal (as requested at the end of the installation process).

  2. Install Python 3.10 with uv:

uv python install 3.10
  1. Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025
  1. Navigate inside the cloned repository:
cd MLPM2025
  1. Create the Python virtual environment using uv:
uv sync
  1. Activate the python virtual environment we just created. ⚠️ NOTE: this must be ran everytime you open a new terminal and want to use the MLPM2025 Python environment.
source .venv/bin/activate

Visual Studio Code Configuration

  1. Install Visual Studio Code on your machine.

  2. Open VS Code and install the official Python extension inside VS Code as follows:

Python extension

  1. Install the official Jupyter extension inside VS Code as follows:

Jupyter extension

  1. Open the MLPM2025 directory inside VS Code using "File" >> "Open Folder".

  2. Open the notebooks/test.ipynb Jupyter Notebook inside VS Code. Select the newly created virtual environment as kernel:

Kernel selection Kernel selection

  1. Run the entire Jupyter notebook by clicking on "Run All" at the top of the notebook. The notebook should run without any issues, and should determine if your installation supports hardware acceleration or not.

Notebook output

  1. To make sure you can use this environment in different folders, you need to add it to the Visual Studio Code settings. Open the "Command Palette" by clicking on "View" -> "Command Palette". Then, search for "User Settings":

Command palette

  1. Search for "venv" in the settings search bar, and add the location of your virtual environment to the "Venv folders" list. ⚠️ NOTE: the folder will be different on your machine. Change to the right location for your specific machine.

Virtual environments list

Q&A

  1. Can I delete the MLPM2025 repository after installation?

No you cannot, because your Python virtual environment is stored entirely inside the .venv folder in the repository.

  1. I want to delete the MLPM2025 virtual environment. How can I do it?

Navigate to the MLPM2025 repository on your machine, and delete the .venv directory.

  1. I messed up the MLPM2025 virtual environment. How can I recover?

Navigate to the root of the MLPM2025 repository on your machine, and delete the .venv directory. Then, run uv sync from a terminal at the root of the MLPM2025 repository.

  1. The TAs told me to update my virtual environment. How can I do it?

Navigate to the root of the MLPM2025 repository on your machine, and run uv sync from a terminal.

  1. I want to install a new package/dependency. How can I do it?

First, make sure you really need that additional dependency. Then, if you absolutely need to install it, use uv add to add a new package to the virtual environment. For example, uv add torchinfo to add the torchinfo package.

References

About

CIVIL-426 | Machine Learning for Predictive Maintenance 2025

Resources

Stars

Watchers

Forks

Contributors

Languages