Hello, MobileNet!#

This is a simple guide to downloading and compiling MobileNet and then benchmarking on the MemryX simulator rather than on installed MX3 hardware. We will compile the lightweight model MobileNet and simulate its performance on a single MXA.

Download#

First, we will download the MobileNet model using Keras’ API and save it as the file mobilenet.h5.

python3 -c "import tensorflow as tf; tf.keras.applications.MobileNet().save('mobilenet.h5');"

Compile#

Next, we compile the model for a single MXA (gen3). This step will produce a binary file called a Dataflow Program (DFP) and save it as mobilenet.dfp.

mx_nc -v -m mobilenet.h5 --sim_dfp

Congratulations, you compiled your first model!

Benchmark#

Finally, we can simulate the performance of the MXA running our compiled model using the hardware simulator.

mx_sim -v -d mobilenet.dfp -f 4

Third-Party License#

This tutorial uses third-party models available through the Keras Applications API. Below are the details of the licenses for these dependencies:

See also