Zhouyi Compass Deployment and Simulation (10) | August challenge

Writing in the front

Do some hardware work this month, just in time to record the potholes.

Related background

Zhouyi Compass is a collection of tools for the NPU. Here, you can use the AIPU NN Compiler and Simulator.

Refer to the tutorial

Just go to the tutorial in the link, it’s no fun copying and pasting.

Tutorial Supplement

  1. Download the environment

This step in the Docker environment is not difficult to do, installation just need a good network, and then need to pull the mirror may be scientific Internet access, this kind of thing to solve, everyone is a programmer, this is not called matter.

  1. Generate model files

In this step, these Python files are from a source. Do not copy them from a second-hand document website.

Pre-training model

export_inference_graph.py

freeze_graph.py

Note: The TensorFlow version of TF 1 is used for most of the results obtained in the current paper that can be deployed on embedded devices. As pointed out in the original tutorial, I used TF 1.15.3, which is relatively new in TF 1. But there are still a lot of warnings when the code is running. (It’s normal for officials to force researchers to update the version of the tool.)

It involves converting TF models from.ckpt to.pb. Export_inference_graph.py You need to install the tF_slim library, otherwise the code will not be used.

To solve the problem of freezing model design, we just need to fix the environment of TF 1 and directly pull a single file from the official warehouse instead of pulling down the entire TF kulla. This design to Git fancy play, do not do an introduction, a search on the Internet.

summary

Official conversion method from CKPT model to PB model and freezing model with pre-training parameters

reference

R329 tutorial book a | AIPU deployment and simulation tutorial