CentOS Anaconda (python3.6) installation TensorFlow

Source: Internet
Author: User

It was an incredibly simple thing to install TensorFlow, but it was on my computer for one weeks. During the encounter all kinds of trouble, all kinds of pits, in this record, convenient for everyone. Errors include:

    • Undefined symbol:zgelsd_
    • Importerror:cannot import name ' MultiArray '
    • WHL is not a supported wheel
1, install Anaconda

: https://www.continuum.io/downloads/(i installed linux-64-python3.6)
I started off directly in Python, but python3.4 (and python3.5) 's NumPy version (1.12.0) seems to have a problem, TensorFlow can be installed successfully, but the runtime calls NumPy for an error. The error is as follows:

Import NumPy Traceback (most recent callLast): File"",Line1,InFile"/usr/local/lib/python3.4/dist-packages/numpy/init.py",Line142,InchFrom. Import Add_newdocsfile"/usr/local/lib/python3.4/dist-packages/numpy/add_newdocs.py",Line13,InchFrom Numpy.lib import Add_newdocfile"/usr/local/lib/python3.4/dist-packages/numpy/lib/init.py",Line18,InchFrom. Polynomial Import *file"/usr/local/lib/python3.4/dist-packages/numpy/lib/polynomial.py",Line20, in from numpy.linalg Import Eigvals, LSTSQ, invfile  "/usr/local/lib/python3.4/dist-packages/numpy/linalg/init.py", Span class= "hljs-built_in" >line 51, in from. Linalg import *file  "/usr/local/lib/python3.4/ dist-packages/numpy/linalg/linalg.py ", line 29, in from numpy.linalg import lapack_lite, _ Umath_linalgimporterror:/usr/local/lib/python3.4/ Dist-packages/numpy/linalg/lapack_lite.cpython-34m.so:undefined symbol:zgelsd_  

On GitHub https://github.com/numpy/numpy/issues/8697 also asked questions, but also did not solve my problem: undefined symbol:zgelsd_. (There have been importerror:cannot import name ' MultiArray ' This problem, for Linux rookie completely do not know how to do)
This is the problem of numpy, it has nothing to do with TensorFlow, but I am too slow to solve it. No fruit, steering Direct Installation Anaconda, installed, NumPy can run normally, TensorFlow installation is extremely tortuous.

2 , install TensorFlow (CPU version)

Familiar with the Anaconda command, you can refer to http://www.jianshu.com/p/d2e15200ee9b
The official recommendation is that you have the GPU immediately, but you can also install a CPU version, and the command to create the environment is:

conda create -n tensorflow python=3.6
(Be sure to specify the Python version, I did not write python=3.6 at first, after various failures)

Download the installation package first, the download path is: HTTPS://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/CPU/TENSORFLOW-1.0.0-CP36-CP36M-LINUX_X86_64.WHL
After downloading, rename the WHL file to TENSORFLOW-1.0.0-PY3-NONE-LINUX_X86_64.WHL, or it will appear

tensorflow-1.0.0-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.

The same error, specific reference https://github.com/tensorflow/tensorflow/issues/1990
Then go into the environment and install TensorFlow

source activate tensorflow #激活tensorflow环境cd /Downloads #切换到whl文件所在文件夹pip install --ignore-installed --upgrade tensorflow-1.0.0-py3-none-linux_x86_64.whl #切记,不要用sudo pip,也不要用pip3,然后--ignore-installed --upgrade等参数也不能省略,否则会出错。

3, install TensorFlow (GPU version)

The commands for creating an environment are: conda create -n tensorflow-gpu python=3.6
Download the installation package first, the download path is: HTTPS://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/LINUX/GPU/TENSORFLOW_GPU-1.0.0-CP36-CP36M-LINUX_X86_64.WHL
Then go into the environment and install TENSORFLOW-GPU

source activate tensorflow-gpu #激活tensorflow环境cd /Downloads #切换到whl文件所在文件夹pip install --ignore-installed --upgrade tensorflow_gpu-1.0.0-cp36-cp36m-linux_x86_64.whl #切记,不要用sudo pip,也不要用pip3,然后--ignore-installed --upgrade等参数也不能省略,否则会出错。

Next, you also need to configure Cuda and CUDNN, can be downloaded to the NVIDIA official website, the following configuration can refer to http://blog.csdn.net/jteng/article/details/52975247

4, verifying the installation

Success.

(tensorflow)$ pythonimport tensorflow as tfhello = tf.constant(‘Hello, TensorFlow!‘)sess = tf.Session()sess.run(hello)

There are problems, runtime, two versions have warning, not error, but do not affect the results, but the execution speed is relatively slow, it is said that because of the different framework of the migration, the CPU has not been compiled, he suggested you for faster speed, can be compiled from the code, execution speed will be faster. Reference https://github.com/tensorflow/tensorflow/issues/8037

W tensorflow/core/platform/cpu_feature_guard.cc:"The TensorFlowLibrary wasn' t compiledToUse SSE3 instructions, but these is availableOn your machineAnd could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:"The TensorFlowLibrary wasn' t compiledToUse SSE4.1 instructions, but these is availableOn your machineAnd could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:"The TensorFlowLibrary wasn' t compiledToUse SSE4.2 instructions, but these is availableOn your machineAnd could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:"The TensorFlowLibrary wasn' t compiledToUse of AVX instructions, but these is availableOn your machineAnd could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:The TensorFlow library wasn' t compiled to use  AVX2 instructions, but these is available on your M Achine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:"The TensorFlow Library wasn' t compiled  to Use the FMA instructions, but these is available on your machine and could speed up  CPU computations.

Transferred from: http://blog.csdn.net/michaelliang12/article/details/60106686

CentOS Anaconda (python3.6) installation TensorFlow

Related Article

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.