Installation
🏷️chap_installation
In order to get up and running,
we will need an environment for running Python,
the Jupyter Notebook, the relevant libraries,
and the code needed to run the book itself.
Installing Miniconda
Your simplest option is to install
Miniconda.
Note that the Python 3.x version is required.
You can skip the following steps
if your machine already has conda installed.
Visit the Miniconda website and determine
the appropriate version for your system
based on your Python 3.x version and machine architecture.
Suppose that your Python version is 3.9
(our tested version).
If you are using macOS,
you would download the bash script
whose name contains the strings "MacOSX",
navigate to the download location,
and execute the installation as follows
(taking Intel Macs as an example):
A Linux user
would download the file
whose name contains the strings "Linux"
and execute the following at the download location:
A Windows user would download and install Miniconda by following its online instructions.
On Windows, you may search for cmd to open the Command Prompt (command-line interpreter) for running commands.
Next, initialize the shell so we can run conda directly.
Then close and reopen your current shell.
You should be able to create
a new environment as follows:
Now we can activate the d2l environment:
Installing the Deep Learning Framework and the d2l Package
Before installing any deep learning framework,
please first check whether or not
you have proper GPUs on your machine
(the GPUs that power the display
on a standard laptop are not relevant for our purposes).
For example,
if your computer has NVIDIA GPUs and has installed CUDA,
then you are all set.
If your machine does not house any GPU,
there is no need to worry just yet.
Your CPU provides more than enough horsepower
to get you through the first few chapters.
Just remember that you will want to access GPUs
before running larger models.