tensorflow and pytorch installation tutorial

tensorflow installation:

1. CPU version tensorflow installation:
Enter the command directly in the anaconda prompt: pip install tensorflow This command installs the latest version

2. GPU version tensorflow installation:
Enter the command in the anaconda prompt:
pip install cudatoolkit=version number
pip install cudnn=version number
pip install tensorflow-gpu=version number

It should be noted that the version numbers of cuda, cudnn, and tensorflow must correspond.

insert image description here

The first two lines of commands are to install cuda and cudnn. As for what cuda and cudnn are, let me briefly explain that computer gpu computing is to put data on the gpu, and cuda is equivalent to a connected thing. cudnn is a tool specially used to complete deep learning. (This explanation is very simple and general, and the specific explanation is at the end of the article)

pytorch install

we go straight topytorch's official website, the official website provides installation commands for GPU and CPU versions.
Find the following interface:
insert image description here
As shown in the figure, select your corresponding system, language, and CPU or GPU. CUDA10.2 and CUDA11.1 in the figure are the corresponding GPU versions. Then enter the command given below into anaconda, and that's it. It's that simple.

CUDA and cuDNN

Here, by the way, explain what CUDA and cuDNN are

The relationship between CUDA and cuDNN:
CUDA is regarded as a workbench equipped with many tools, such as hammers and screwdrivers. cuDNN is a CUDA-based deep learning GPU acceleration library. With it, deep learning calculations can be completed on the GPU. It is equivalent to a working tool, for example, it is a wrench. But when the CUDA workbench was bought, no wrench was given. If you want to run a deep neural network on CUDA, you need to install cuDNN, just like you need to buy a wrench if you want to twist a nut. Only in this way can the GPU perform the work of the deep neural network, and the working speed is much faster than that of the CPU.
This explanation is quoted from: https://www.jianshu.com/p/622f47f94784

For a more detailed explanation of CUDN, you can refer to this blog post: https://blog.csdn.net/xiaoxiaolibai/article/details/104770046

Guess you like

Origin blog.csdn.net/weixin_51610638/article/details/120879348