Introduction
Overview
This section describes how to change a TensorFlow network with control flow operators (as shown in Figure 1) to a TensorFlow network with function operators (as shown in Figure 2), which you can convert into an offline model adapted to the Ascend AI Processor by using ATC.
Prerequisites
- You have connected the server of this tool to the Internet.
- You have installed Bazel.
To install this compiler, you can visit: https://docs.bazel.build/versions/master/install-ubuntu.html
- You have installed TensorFlow and future.
You can skip this step if a TensorFlow dependency exists in the func2graph.py script in your ATC installation path. If it is not found with the command pip3.7.5 list, install it with the following command.
pip3.7.5 install tensorflow==1.15 --user
You can also skip this step if you have installed future and patch that are necessary for Bazel. If they are not found with pip3.7.5 list, install them with the following commands:
pip3.7.5 install future --user pip3.7.5 install patch --user pip3.7.5 install numpy --user
If you run the preceding commands over the disconnected Internet and get a prompt "Could not find a version that satisfies the requirement xxx", fix the error by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3.7.5 install" Is Run?

