Install the deep learning framework TensorFlow in Ubuntu
I recently learned about TensorFlow, a new open-source deep learning framework for Google. It was found that python 2.7.x is needed when installing it; I have been using CentOS for Linux before. While CentOS is not updated, the built-in Python is usually less than python2.6. In addition, many components in the system depend on python2.6, so you cannot replace it. In desperation, I chose Ubuntu. The following describes some problems encountered when installing TensorFlow with Ubuntu.
In-depth explanation of Google SyntaxNet: New TensorFlow Natural Language Processing Model
Open-source system TensorFlow 0.8 released-Support for Distributed Computing
1. Ubuntu cannot be connected using Winscp
Solution:
(1) Use a bridge to access the Internet (because it is an operating system installed on a virtual machine)
(2) Use ps-e | grep ssh to check whether the sshd process is enabled. If not, install openssh-server.
Installation Method: sudo apt-get install openssh-server
Start the corresponding process:/etc/init. d/ssh start
(3) The reboot system is required at this time.
(4) because the original root user of ubuntu is not activated, You need to modify the root user password to activate the root user.
The connection is completed.
2. Install tensorflow.
Since my ubuntu is the latest version (ubuntu-16.04-desktop-amd64), the built-in python inside is 2.7.11. Therefore, the requirements are met. Tensorflow has three installation methods: pip installation. Install tensorflow as follows:
(1) first install pip
Sudo apt-get install python-pip python-dev
(2) install tensorflow using pip
Sudo pip install -- upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
After installation, as shown in:
According to the yellow prompt above, ask me to upgrade pip: So I upgraded according to his requirements, and execute: pip install -- upgrade pip
3. Check whether tensorflow is successfully installed.
Run the following code to test whether tensorflow is successfully installed:
$ Python
...
>>> Import tensorflow as tf
>>> Hello = tf. constant ('hello, TensorFlow! ')
>>> Sess = tf. Session ()
>>> Print (sess. run (hello ))
Hello, TensorFlow!
>>> A = tf. constant (10)
>>> B = tf. constant (32)
>>> Print (sess. run (a + B ))
42
>>>
The following shows the result of my execution:
4. Install python-numpy, python-scipy, and python-matplotlib.
Sudo apt-get install python-numpy
Sudo apt-get install python-scipy
Sudo apt-get install python-matplotlib
Verify whether the installation is successful (as shown in)