There are many different ways to deploy a trained neural network model to a mobile or embedded device. Different frameworks support Arm, including TensorFlow, PyTorch, Caffe2, MxNet and CNTK on a variety of platforms, such as Android, iOS and Linux. The deployment process for each is similar but every framework and operating system may use different tools. This walkthrough looks specifically at preparing TensorFlow models for deployment on Android, Linux, and iOS.
Optimization of a trained neural network model with TensorFlow follows these steps:
- Determine the names of the input and output nodes in the graph and the dimensions of the input data.
- Generate an optimized 32-bit model using TensorFlow's transform_graph tool.
- Generate an optimized 8-bit model that is more efficient but less accurate using TensorFlow's transform_graph tool.
- Benchmark the optimized models on-device and select the one that best meets your deployment needs.
This tutorial goes through each step in turn, using a pretrained ResNet-50 model (resnetv1_50.pb). The process is the same for other models, although input and output node names will differ.
At the end of this tutorial you will be ready to deploy your model on your chosen platform.