[Deep learning environment configuration] windows version (anaconda, vscode)

1. Environmental management software——Anaconda

1.1 Download and install

(1) Tsinghua mirror image download : download link .

  • Choose the latest dated x64 version.

(2) Installation :

  • Always next. Do not check to add environment variables automatically, and add them manually later. The reason is that some computers will have problems after automatic addition, and finally do it manually.
  • Manually add environment variables: Open the computer search (shortcut key: win key + q), search for environment variables, then click in turn according to the picture, add the four paths as shown in the picture (the installation path of your own computer)

1.2 Conda source change

1.3 Speed ​​up pip installation

  • Although conda has changed the source, some packages cannot be installed with conda. You still need to use pip, but the download of pip is very slow without changing the source. When pip installs a package, add the following sentence at the end. Temporarily specify the source .
-i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com

2. IDE software——Vscode

1.1 Download and install

1.2 Add extension

  • Chinese pack
  • python package

1.3 Changing the compiler

  • Open a python file and select the created conda environment in the lower right corner of vscode.

Three, python package installation

1. Install pytorch

  • Make sure that conda has changed the source according to the above operation
  • Choose the one that suits your computer on the pytorch official website: https://pytorch.org/get-started/locally/
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
  • test
import torch
torch.__version__
torch.cuda.is_available()

2. Install opencv

  • It seems that it can't be installed with conda install, so I use pip.
pip install opencv-python -i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com

Guess you like

Origin blog.csdn.net/weixin_44029896/article/details/127097877