This repository accompanies the workshop Introduction to Deep Learning: Hands-on Workshop in Computer Vision. See below for detailed instructions on setting up the necessary software on your computer.
- MNIST.ipynb: Handwritten digit classification on the MNIST dataset. Some code cells are empty.
- MNIST-complete.ipynb: Like MNIST.ipynb, but all code cells are filled already.
- CMIYC.ipynb: Traffic sign recognition with the "Crash me if you can" demonstrator. All code cells are filled already.
Note: The easiest way is to set up the software locally, on the very laptop you are going to use during the workshop. We will not need lots of computing resources, only approx. 4 GB of disk space and a medium-strength CPU with >= 8 GB of RAM.
Clone or download this repository to your computer:
$ git clone https://github.com/risc-mi/dl-cv-workshop.git
Make sure Miniconda is installed on your system. You can check if it is already installed with
$ conda -V
If the above command succeeds and prints a relatively recent version number (around 24.5.0), you can jump to Step 3.
Otherwise, install Miniconda using the above link. It is available for all major operating systems, including Windows, MacOS, and Linux.
Miniconda provides a minimal Python installation with an integrated package manager, and allows to easily create and manage dedicated Python environments.
Note: Even if you have Python pre-installed (e.g., on Linux), it is strongly recommended to use Miniconda.
Open a terminal window and cd
to the directory containing the local clone of this repository (Step 1). Then execute the following command:
$ conda env create --file environment.yml
After a few seconds, you might be asked to confirm creating a new environment and downloading a couple of packages amounting to approx. 4 GB. If so, please confirm and wait until all packages are downloaded and installed. Depending on your computing environment, this may take a few minutes to a few hours - please be patient. Then, execute
$ conda activate dl_cv_workshop
to verify that the environment was properly set up. You can then also start a new Python interpreter by executing
$ python
and importing some example packages, like
>>> import torch
>>> import cv2
If this does not throw any exception, everything seems to be fine, and you can exit the interpreter again with
>>> exit()
If import cv2
throws an exception that reads something like
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
then
apt-get install libgl1
might solve the problem (see also here).
If you have an NVIDIA- or AMD GPU, you can install the GPU-version of PyTorch. To check for an NVIDIA GPU, execute
$ nvidia-smi
If the command succeeds, you should get a table-like output with information about the CUDA version installed on your system, which should be either 11.8 or 12.1. In that case, you can install the GPU-version of PyTorch with
$ conda install pytorch pytorch-cuda=<YOUR CUDA VERSION> -c pytorch -c nvidia
Check the official installation instructions if anything goes wrong or you have an AMD GPU.
Note: A GPU is not required for the workshop, but can significantly speed up computations, in particular, model training.
If you run into problems, do not hesitate to drop Alexander Maletzky (@ RISC-Software) an e-mail, or open an issue.