Easy tutorial for installing TensorFlow under windows with Pycharm

Source: Internet
Author: User

79760616

Recently began to learn the relevant knowledge of deep learning, ready to combat, read some about TensorFlow installation blog, around a few bends, so to fill the pit (redundant installed or non-Windows), mainly around the use of pycharm need to tensorflow installation process.

Environment: WINDOWS10 Professional Edition. Just want to run a little bit tensorflow, the installation process is really simple.

If you have "install the IDE and associated with the compiler" experience, do not want to see the complex installation instructions, you can try to see this directory with their own understanding loaded, there are problems to examine.

1. Install Python, recommended 3.5 or later

2. Install the Pycharm and associate the Python interpreter in Pycham, giving the path where the Python.exe is located.

3.Pycharm file->settings->project Xxx:->project Interpreter, right-hand list any double-click on an item to open the Available package (List of installable packages) , find the version of TensorFlow you want and click Install package. GPU version requires a graphics card that supports CUDA and installs Cuda and CUDNN.

Objective

First of all, for Windows under the installation of TensorFlow, some blog is called to install Anaconda, Cuda (detailed self-search), I think it is not very good. About Anaconda, the essence is a well-integrated package, five hundred or six hundred m in the form of Python and some science pack, there is no tensorflow. Seniors gave me the bag but I do not use, in fact, there are a lot of bags I do not have, I think the use of what next, because the PIP is very convenient, especially after pycharm, in fact, do not need to use the PIP command like other tutorials to get the package.

1. Install Python (if you already have Python, you can skip this step)

Refers to the Python interpreter (interpreter) and some suites, a bit like the C when the compiler feel, find the resources to run the EXE basically installed. With regard to the version, the later version of tensorflow1.2 requires a later version of 3.5. About the difference between 2.x and 3.x there is a OH interest can be referenced

Http://www.runoob.com/python/python-2x-3x.html

2. Select an IDE

Good IDE can improve efficiency, I use the pycharm, this to see a person likes. Anaconda has its own spider.

Pycharm Resources and installation tutorials a lot, here skip.

Example: 70307933?locationnum=11&fps=1

When the IDE installs, it asks if the interpreter is associated, and if you are not careful, you can also open file->project:xxx->project interpreter to correlate the path of the interpreter. This process is similar to using the Codeblocks Association compiler. At this point the basic Python is ready to use.

Figure 1 Project Interpreter

Another: File->settings->color scheme can choose the skin.

3. Installing TensorFlow

Some tutorials are recommended by using PIP, which is handy. There are Pip.exe and Pip3.exe in the Scripts folder in the Python directory. You can complete the installation by entering some instructions at the command line. Details: 53418159

But I cmd really not very good, pycharm installation is actually more convenient (essentially or PIP, but do not need to lose their own instructions)

Method Source: https://jingyan.baidu.com/article/335530dafdbb3619cb41c3a8.html

Method: In the 1 interface, double-click a packge, such as Pip. Then you can see the list of installable packages, and it's easy to find the package that you need, and then click Install. The right sidebar is the description of the package, and you can select a specific version below (with Python3.6 less than 1.2 versions). The blue one in the list is already installed.

You'll have it in your list later, as shown in 1. Even if only tensorflow will carry a bunch of matching things, such as numpy,tensorboard; don't worry at all. In addition, if you need pandas, install the same method.

If you need to run TensorFlow with the GPU, you should make sure that your graphics card supports cuda and that you should install Cuda and CUDNN and choose Tensorflow-gpu

See more: 53418159

Different versions of TensorFlow support specific versions of Cuda,cuda, CUDNN should be matched with TensorFlow

A lot of tutorials do not emphasize, release is also relatively early, easy to have pits.

tensorflow1.6 start supporting CUDA9.0,CUDNN also need matching, find Cudnn x.x.x for CUDA9.0 such.

tensorflow1.6 or 1.7 with CUDA9.1 is not good, should use 9.0, I was the pit. But fortunately there is a solution, thank you for this article:

79433298

So I wrote a detailed tutorial on using CUDA9.1 's TensorFlow:

79871564

Update: TensorFlow package is relatively large, installed more slowly than the ordinary small package, please ensure that the program is running smoothly and the conditions of the network to wait patiently. If you use the command line and PIP installation, you can clearly see the progress of the installation, for the installation process is very doubtful can use this method.

Postscript

Try out the fans in general other pits.

If the TensorFlow is installed, the hand is TENSORFLOW-GPU and the TENSORFLOW-GPU is run by default. Classmate that machine does not support Cuda, began to error. The above list of installation methods does not support deletion. You can open cmd and enter the PIP list so that you can see all the packages that have been installed. Pip uninstall TensorFlow and pip uninstall Tensorflow-gpu can delete both packages. Then reinstall TensorFlow.

If your computer is a window system and has two Python interpreters installed, such as 3.6 and 2.7, then there will be an error when installing the package above, and the use of the PIP command directly in CMD also has a problem and cannot find the resources. I honestly unloaded the 2.7.

Update: Both python3.6 and python2.7 are installed on Linux servers, which can be used to complement the impact of the operation. The main reason is the path designation of the relevant program. So it is assumed that the appropriate modification of environment variables on Windows can make different versions of Python work correctly.

About: "Your CPU supports instructions This TensorFlow binary is not compiled to USE:AVX2" warning is that your CPU supports AVX2 instruction set and can run faster, but Is this version of the TensorFlow does not support, ignore the good, or install the tutorial to add the Mask warning statement (each time add more trouble, anyway this also did not affect, I really want to use GPU version or server).

Update: Mind/wheels on GitHub has published a tensorflow that supports the AVX instruction set, as described at the end of this article:

79871564

Easy tutorial for installing TensorFlow under windows with Pycharm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.