The installation environment is really troublesome. Third-party tools have the advantage, that is, free installation. The disadvantage is that if you don’t know it, there are many detours when you don’t understand it.
Fortunately, I learned the cmd command and understood its tools. Thanks to friends on the Internet for their summary. Although the road is curved, my heart is really straight.
Everyone has a different perspective and a different learning perspective. Long live understanding and long live practice!
QQ: 1034828302 study together
1. Whether the network card of the machine is installed, use nvidia-smi this command, sometimes the path is different, this should pay attention to
C:\Users\PC>nvidia-smi
Sun Dec 27 07:36:56 2020
+--------- -------------------------------------------------- ------------------+
| NVIDIA-SMI 456.71 Driver Version: 456.71 CUDA Version: 11.1 |
|---------------- ---------------+----------------------+----------- -----------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M . |
|==============================+==================================================================================================================================================================================================================================================================== =======+======================|
0 GeForce RTX 2060 WDDM | 00000000:01:00.0 On | N/A |
| 0% 30C P8 1W / 160W | 433MiB / 6144MiB | 3% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 2148 C+G ...cent\WeChat\wechatweb.exe N/A |
| 0 N/A N/A 2292 C+G Insufficient Permissions N/A |
| 0 N/A N/A 5184 C+G ...w5n1h2txyewy\SearchUI.exe N/A |
| 0 N/A N/A 6532 C+G ...ekyb3d8bbwe\YourPhone.exe N/A |
| 0 N/A N/A 6556 C+G ...b3d8bbwe\WinStore.App.exe N/A |
| 0 N/A N/A 6724 C+G ...es.TextInput.InputApp.exe N/A |
| 0 N/A N/A 9220 C+G ...ekyb3d8bbwe\HxOutlook.exe N/A |
| 0 N/A N/A 9596 C+G ...lPanel\SystemSettings.exe N/A |
| 0 N/A N/A 9708 C+G ...artMenuExperienceHost.exe N/A |
| 0 N/A N/A 11672 C+G ...kyb3d8bbwe\HxAccounts.exe N/A |
| 0 N/A N/A 13180 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 14264 C+G ...me\Application\chrome.exe N/A |
| 0 N/A N/A 14916 C+G ...sk\BaiduNetdiskRender.exe N/A |
+------------------------------------------------- ----------------------------+
Only care about the main points. NVIDIA-SMI 456.71 Driver Version: 456.71 CUDA Version: 11.1
2. View the CUDA version. Because it needs to match with other versions (cudnn tenslorflow), use pen records. Or familiar with it over and over again
C:\Users\PC>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:12:04_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11 .1.74
Build cuda_11.1.relgpu_drvr455TC455_06.29069683_0
Three, Anaconda3-2019.10-Windows-x86_64.exe installation
selects the automatic setting of system variables.
Four, update conda to the latest version: conda update -n base conda to
check the conda version: conda -V
and then execute: conda update --all
5. Install python specifies its installation path, please remember its path
conda create --prefix=D:\python37\py36 python=3.7
六、 conda install tensorflow-gpu
Seven, python -m site python installation has different paths, I am not sure about the specifics, use this command to view
eight, the current python path
where python
nine, whether python is installed successfully
python run test, or python --version
ten, configure pythcharm surroundings
11. Test the code, run
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Do not display prompt messages below level 2
print('GPU', tf.config.list_physical_devices('GPU'))
a = tf.constant(2.0)
b = tf.constant(4.0)
print(a + b)
Twelve,
d:\ dir python.exe /a/s/w/p
D:\ProgramData\Anaconda3\python.exe This python run command is here,