Tensorflow two-step installation (super simple)

1. Check the python version and download the corresponding tensorflow file

1. Anaconda has been installed, find the Anaconda3 folder, double-click to open the anaconda prompt, enter python, and check the python version

 You can see that my version is 3.9

2. Enter the following website and select the cpu or gpu version you need. Be sure to pay attention to the selection that matches your python version. 
tensorflow-cpu version: cpu-tensorflow
tensorflow-gpu version: gpu-tensorflow

Click the link, the bottom is the latest one, my version is 3.9, take the gpu version as an example, I chose the wheel file in the picture below, cp39 means adapting the python3.9 version. (A blogger said that when choosing, generally choose a name that is concise and not easy to make mistakes)

 

Click directly to download, and the download will be completed in a few minutes.

2. Move the file to the corresponding location and enter the installation command

1. Find the Anaconda folder, then go to the Lib folder, and then go to site-packages, create a new folder named tensorflow, and put many files installed later here, so that you won’t find them in a mess.

 Cut/copy the downloaded wheel file to the tensorflow folder

 2. Open the Anaconda prompt from Anaconda3 again

 ①If Anaconda is on the D drive, enter as follows, first switch to the D drive, and then enter the installation command, which is pip install + version file name (with suffix)

Command statement:

(base) C:\Users\lenovo>d:

(base) D:\>cd Anaconda\Lib\site-packages\tensorflow

(base) D:\Anaconda\Lib\site-packages\tensorflow>pip install tensorflow_gpu-2.8.0-cp39-cp39-win_amd64.whl

Diagram:

 ②If Anaconda is on the C drive, open the anaconda prompt mentioned above, and use the cd command to cut the path to the newly created tensorflow folder

 

 After that, enter the installation command pip install + version file name as ① 

 Finally, press the Enter key, wait for a few minutes, and the download is complete.

Check whether the download is successful, still open Anaconda Prompt (anaconda), enter pip list, find the tensorflow version, success!

 

Guess you like

Origin blog.csdn.net/weixin_50659071/article/details/128049493