Deployment and Simulation of Zhouyi Compass (24) | More challenges in August

Writing in the front

Do a little hardware related work this month, and just keep track of the potholes.

Related background

Zhouyi Compass is a collection of Zhouyi NPU tools. Here we mainly introduce the use of AIPU NN Compiler and Simulator.

Refer to the tutorial

Just go to the tutorial link, I don’t have any fun copying and pasting.

Supplement to tutorial

  1. Download the environment

In this step, docker environment is not difficult to handle, just need a good network when installing, and then need to pull the image may need to scientific Internet access, this kind of thing to solve by themselves, we are all programmers, this is not a matter.

  1. Generate model file

All of the Python files in this step are from a source, so don’t find any second-hand documentation sites on the Internet.

Pretraining model

export_inference_graph.py

freeze_graph.py

Note: The TensorFlow version used in most of the papers that can be deployed on embedded devices is TF 1. As pointed out in the original tutorial, I used TF 1.15.3, a relatively new version of TF 1. But there are still plenty of warnings in the code (the official routine of forcing researchers to update the tool version is fine).

Export_inference_graph. py is required to install the tF_slim library, otherwise the code will not be usable.

From design to model freezing, as long as the environment of TF 1 is settled, you can directly pull a single file from the official warehouse, instead of pulling down the whole TF library. This design to git fancy play, do not do the introduction, a large number of online check.

summary

Official conversion method of CKPT model to PB model and freezing model using pre-training parameters

reference

R329 tutorial book a | AIPU deployment and simulation tutorial