Deep learning environment configuration under Windows (CPU&GPU version) [Li Mu-hands-on deep learning]

1. Getting started with installation

Directly watching the installation video of Mr. Li Mu is very dissuading for Xiaobai. It is strongly recommended to watch the following video. It is very clear about the software and configuration, installation and verification in the environment configuration, which is helpful to understand the relationship between each software. relationship.
[The most detailed PyTorch entry deep learning environment installation and configuration CPU GPU version under Windows]
insert image description here

Blogger configuration version
CUDA driver version is 12.1
pytorch (GPU) version is 2.0
Anaconda version is 2023.03
configured python3.8 version

insert image description here

insert image description here

2. Create a virtual environment

The virtual environment can be named with a meaningful name, and I will learn courses in this environment later. I directly use pytorch to name it.

Create a virtual environment (such as tuduipytorch), choose one of three:

  • 1. Use the conda create command to create a new virtual environment
    — conda create -n virtual environment name python=version
  • 2. Add mirror acceleration
    —conda create -n virtual environment name python=version -c mirror address
  • 3. Just use the base environment

It should be noted that if you use the GPU version, you must list it to see if it is the GPU version!

After watching the video to understand the functions of each software and package and create a good environment and necessary libraries such as torch, torchvision, torchaudio, cudatoolkit, then install jupyter notepad and d2l software packages.

3. Notepad and d2l software package installation

Open the anaconda terminal.
The pytorch environment under my Anaconde is named pytorch (using my own environment name), so activate pytorch before using it

conda activate pytorch

Download Mr. Li Mu's d2l-zh, put it in a suitable location and unzip it. insert image description hereNext, install jupyter notepad and d2l package, and continue to enter in the terminal

pip install jupyter d2l

After installation, use the jupyter notebook command to open the webpage, use the command

jupyter notebook

You can open jupyter on port 8888 of this machine, and the webpage will open automatically
insert image description here

Since my d2l is directly placed in the default address of the virtual environment, I can use jupyter notebook directly, and then find d2l.

What to do if d2l cannot be found in the terminal

If the d2l file is not placed in the default environment, you can use named cd + the address of the d2l file you placed, and then use jupyter notebook to name after jumping.
Among them, the file address can be viewed and copied in the right-click-properties-security.

cd D:\deeplearning\d2l-zh

insert image description here

insert image description hereinsert image description here

At this time, a web page containing only d2l is obtained
insert image description here

4. Run an example to try

Follow Mr. Li Mu to run an example to see your own speed. Mine is too slow, crying dizzy.
[Install CUDA and Pytorch under Windows to run deep learning - hands-on deep learning v2]
insert image description here

5. Jupyter Noteboo runs its own code

[Using Jupyter Notebook]
We will use Jupyter Notebook initially, then we can start learning the courses of Teacher Li Mu!

6. References

The most detailed introduction to PyTorch under WindowsInstallation and configuration of deep learning environmentInstallation and configuration of CPU GPU versionWindowsInstall
CUDA and Pytorch to run deep learning-hands-on deep learning v2Configure deep learning
environment in miniconda under windowsUse
Jupyter Notebook

Guess you like

Origin blog.csdn.net/weixin_48412658/article/details/130112586
Recommended