[2023 CANN Training Camp Season 1] Chapter 2 of Ascension AI Introductory Course (TensorFlow) - TensorFlow Model Migration & Training

1. Introduction to the basic knowledge of AI model development

1.1 Experience in Python programming

a. define and call functions with positional and keyword arguments
b. dictionaries, lists, sets (create, access and iterate)
c. for loops, for loops with multiple iterator variables (eg, for a,b in [( 1,2),(3,4)])
d.if/else conditional block and conditional expression
e.string format (for example, "%.2f % 3.14)
f.variables, assignments, basic data types (int, float, bool, str, etc.)

1.2 Understanding Deep Learning and Neural Networks

In order for the computer to grasp the knowledge understood by humans, it is necessary to construct a multi-layer connection network composed of simple concepts to define complex objects. After the iterative calculation and training of this network, the computer can grasp the characteristics of this object. This method is generally called as Deep learning (Deep Learning, DL).
The development of the Internet has produced a huge amount of data, which provides greater opportunities for the development of deep learning, and also makes artificial intelligence a hot spot today, and deep neural networks have become a hot spot among hot spots. After a series of developments, deep learning has shown great application value and has been closely watched by industry and academia. Deep learning has made significant progress in image, voice, natural language processing, big data feature extraction and advertising click rate prediction
For the introduction of the basic principles and concepts of deep learning, please refer to the deep learning video course at station B

1.3 Understand the TensorFlow framework

tutorial

1.4 Understand the CANN-based model development process

insert image description here
The Yiteng 910 AI processor is a neural network processor dedicated to artificial intelligence (AI) released by Huawei in 2019. At present, most training scripts in the industry are developed based on TensorFlow's Python API, and run on CPU/GPU/TPU by default. In order to make it possible to use the surging computing power of the Yiteng 910AI processor to perform training and improve training performance, we need to use CANN to implement TensorFlow The model is adapted and trained. The following is the CANN-based model development process: Tutorial

2. Detailed Explanation of TensorFlow AI Model Migration

2.1 Two migration methods

There are two main ways to migrate the TensorFlow network model to the Yiteng AI processor for training:

1. One is the automatic migration method. Scan the AST syntax tree of the original script through the migration tool, which can automatically analyze the support degree of the native TensorFlow API on the Yiteng AI processor, and automatically migrate the original TensorFlow training script to a script supported by the Yiteng AI processor. For APIs that cannot be migrated automatically, you can refer to the migration report output by the tool and make corresponding modifications to the training script.
2. One is manual migration. Algorithm engineers need to manually analyze the API support in the TensorFlow training script, and refer to the documentation to manually modify the unsupported APIs one by one in order to train on the Yiteng AI processor. This method is more complicated, and we recommend that you use the automatic migration method first. .

2.2 Detailed Explanation of Automatic Migration

Automatic migration is to scan the AST syntax tree of the original script through the tool, which can automatically analyze the support degree of the native TensorFlow API on the Yiteng AI processor, and automatically migrate the original TensorFlow training script to the script supported by the Yiteng AI processor , for APIs that cannot be migrated automatically, you can refer to the migration report output by the tool and make corresponding adaptations and modifications to the training script.

help document

2.3 Detailed Manual Migration

Manual migration requires algorithm engineers to manually analyze the API support in the TensorFlow training script, and refer to the document to modify the unsupported API one by one to train on the Yiteng AI processor. This method is more complicated, and we recommend that you use it first. Automatic migration method.
Learning Documents
Online Experiments

Chapter Quiz

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_45257495/article/details/130867861