First, download anaconda, install.
sudo bash ana...........sh
Second, configure environment variables
Add the last sentence:/home/py/ana/bin is the installation address
Installation completed reboot.
Enter Python. I saw Anaconda.
Third, Conda Environment
Create an PY3.5 version of the environment named TensorFlow
Here the official website says with the default source. It is quicker to use the one I recommended below.
Conda install-n tensortflow-c Https://conda.anaconda.org/jjhelmus TensorFlow
IPython, advanced Python runtime environment
is now renamed Jupyter (http://jupyter.org/), which supports the sharing of algorithmic models through notebook.
Spark, high performance parallel computing environment
From Https://conda.anaconda.org/anaconda-cluster you can access to the integrated spark version.
Installation:
conda
install
-n tensor -c https://conda.anaconda.org/anaconda-cluster spark
TensorFlow, machine learning engine
TensorFlow is an open-source, neural-based machine learning engine from Google that accesses details from https://www.tensorflow.org/.
Installation:
conda
install
-n tensor -c https://conda.anaconda.org/jjhelmus tensorflow
Iv. TestingTest procedures on the official website. Demo for training a linear data
ImportTensorFlow as TFImportNumPy as NP#Create phony x, y data points in NumPy, y = x * 0.1 + 0.3X_data = Np.random.rand (100). Astype (np.float32) Y_data= X_data * 0.1 + 0.3#Try to find values for W and b that compute y_data = W * X_data + b#(We know that W should is 0.1 and B 0.3, but TensorFlow would#Figure which is out for us.)W = tf. Variable (Tf.random_uniform ([1],-1.0, 1.0)) b= TF. Variable (Tf.zeros ([1])) y= W * X_data +b#Minimize the mean squared errors.Loss = Tf.reduce_mean (Tf.square (Y-y_data)) Optimizer= Tf.train.GradientDescentOptimizer (0.5) Train=optimizer.minimize (loss)#before starting, initialize the variables. We'll ' run ' this first.init =tf.initialize_all_variables ()#Launch the graph.Sess =TF. Session () sess.run (init)#Fit the line. forStepinchRange (201): Sess.run (train)ifStep% 20 = =0:Print(step, Sess.run (W), Sess.run (b))#learns best fit is W: [0.1], B: [0.3]
This is the py3 that can run straight.
It is recommended that you use sublime to write code on Ubuntu.
Results
ubuntu16.01 Anaconda under the TensorFlow installation