Install the Anaconda distribution, then open Anaconda prompt.
-
Download the environment.yaml for the course.
-
In Anaconda prompt, navigate to the directory containing the environment.yaml and write
conda env create -f environment.yaml
. -
Activate the new environment with
conda activate ml
. -
Move onto the Installation of PyTorch section.
See here for more detailed guide of steps 1-2, 5-7.
-
Create a new Python environment with
conda create -n ml python=3.8.5 anaconda
. -
Activate the new environment with
conda activate ml
. -
Navigate to directory containing the requirements.txt of this repository (here).
-
Write
pip install -r requirements.txt
. -
Move onto the Installation of PyTorch section.
-
Open the PyTorch installation page.
-
Select your specifications. If using GPU, follow instructions in Enable GPU section below first. Otherwise, under CUDA, select None.
-
Copy the given command and run it in Anaconda prompt.
If you have a CUDA enabled GPU, you can take advantage of GPU acceleration. If you already have CUDA installed, skip steps 1-3.
-
Install a NVIDIA GPU driver from here.
-
Install CUDA toolkit, this course originally used version 11.1 but feel free to use a more recent version that is displayed here under CUDA.
-
Install cuDNN.
-
Confirm installation by writing
nvcc --version
in Anaconda prompt, the CUDA version should appear (such as cuda_11.1). -
Once complete, install PyTorch using instructions in Installation of PyTorch section above.
Once your environment is setup, it can be added as a kernel to Jupyter lab/notebook by:
-
In Anaconda prompt write
conda active ml
. -
Then write
python -m ipykernel install --user --name ml --display-name "ML"
-
The kernel has been installed, switch back to base with
conda activate base
then open Jupyter withjupyter lab
/jupyter notebook
.