Using sowteno 2.0

Time:2020-10-29

Tensorflow is Google’s open source artificial intelligence library, which has the most perfect ecological support. It is a necessary tool for the development and scientific research in the field of artificial intelligence.
In this paper, under Windows 10, with the help of anaconda, tensorflow 2.0 is installed.

tensorflow2.0

install

First open anaconda and execute the

conda create --name tf2.0 python=3.7  

Create a virtual environment called tf2.0.
Using sowteno 2.0

I don’t want to talk about the details. Refer to my previous article, I always choose yes and install it. If you report an error in the word httpsconnectionpool, it is the reason for the slow network speed. Try it several times.

Successfully entered the tf2.0 environment

conda activate tf2.0   

Installing tensorflow 2.0

pip install tensorflow==2.0.0-beta1  

Using sowteno 2.0
There are a lot of things to download, wait a little longer, and the final success is as follows
Using sowteno 2.0

use

Command line, run python, execute

import tensorflow as tf

If there is a warning but no error is reported, the installation is successful. The warning is due to the version problem of some packages, which can be ignored.
Using sowteno 2.0
An example of matrix multiplication can give the result correctly.
Using sowteno 2.0

jupyter notebook

In Python testing, there is a very useful tool jupyter notebook. With this tool, you can input code on the browser and view the results. It is more flexible than using the command line or editing. Py code file, which can greatly improve the work efficiency.

install

We are still installing in tf2.0,

pip3 install jupyter notebook

Using sowteno 2.0

use

After the installation is successful, execute jupyter notebook, which is similar to starting Tomcat
Using sowteno 2.0
The browser will automatically open the web address
Using sowteno 2.0
On the right, select python3 and enter the
Using sowteno 2.0
Input matrix multiplication example, click the top to run, as shown below
Using sowteno 2.0
The code can be executed line by line and pasted in together. It’s very convenient. Finally, you can save all the code without worrying about losing code when you close the browser. The save function is as follows
Using sowteno 2.0

There are many formats to save.

summary

Even if the most basic tensorflow environment is established, you can run some official examples of Google in the browser, build models, train models, define loss functions, and test results in a line or two.
Search for “tensorflow examples” online, the threshold is not high.
Tensorflow2 and tensorflow1 are very different. Don’t install version 1 and learn 2 directly.

Recommended Today

Learn D3 getting started document: Data

Introduction FollowLearn D3: By ExampleThe third article is only an English translation. The modifiable code is replaced by static pictures. If you want real-time interaction, please read the original text. Original text:Learn D3: Data Version: Published Mar 24, 2020 Origin My GitHub text There are several methods on observableget data。 But since we’re just getting […]