Tensorflow——Tensorflow usage, installation, data flow diagram

1 Introduction

Has machine learning that has been on fire in recent years make you tempted? Learning google to develop customized tensorflow can let you become a machine learning, neural network's big cow, and will also benefit greatly from the massive amount of information.

2. What is the use of TensorFlow?

TensorFlow is a neural network Python external structure package developed by Google, and an open source software library that uses data flow graphs to perform numerical calculations. TensorFlow allows us to draw a calculation structure diagram first, which can also be called a series of human-machine Interactive calculation operation, and then convert the edited Python file into more efficient C ++, and calculate in the back end.

TensorFlow is undoubtedly one of the best libraries in neural networks. Its task is to train deep neural networks. By using TensorFlow, we can quickly get started with neural networks, which greatly reduces deep learning (that is, deep neural The development cost and difficulty of the network). TensorFlow's open source, so that everyone can use and maintain, consolidate it. So that it can be quickly updated and improved.

3. Tensorflow installation

3.1. Linux and MacOS

#cpu
$ pip install tensorflow      # Python 2.7
$ pip3 install tensorflow     # Python 3.n

#gpu
$ pip install tensorflow-gpu  # Python 2.7
$ pip3 install tensorflow-gpu # Python 3.n

3.2.Windows

#cpu
pip3 install --upgrade tensorflow

#gpu
pip3 install --upgrade tensorflow-gpu

3.3. Test whether the installation is successful

After entering python in the terminal to enter the python environment, enter the following code:

import tensorflow

Check current version and path

import tensorflow as tf

tf.__version__
tf.__path__

4. Data flow diagram

Tensorflow must first define the structure of the neural network, and then put the data into the structure to operate and train.

Because TensorFlow uses data flow graphs to calculate, so first we have to create a data flow graph, and then put our data (data exists in the form of tensor) in the data flow graph Computing. Nodes represent mathematical operations in the graph, and edges in the graph represent multidimensional data arrays that are interconnected between nodes, that is, tensor. When training a model, the tensor will continuously extract data from the data flow graph. One node in the flow to another node, this is the origin of the name TensorFlow.
Insert picture description here

Published 227 original articles · praised 633 · 30,000+ views

Guess you like

Origin blog.csdn.net/weixin_37763870/article/details/105478410