Preparing .npy Data of a TensorFlow Model

Prerequisites

Prepare a .pb model (ResNet-50 is used in this example).

Procedure

  1. Go to the directory where the .pb file is stored.
  2. Create the dump script file tools_tensorflow_dump.py (code reference).
  3. Dump data.
    Specify the .pb file, input .bin file for model inference, and input node name.
    python3 tools_tensorflow_dump.py resnet50_tensorflow_1.7.pb -i test.bin -n 'Placeholder:0' -s [1,224,224,3] -a
  4. Generate the result.

    The following figure shows the generated .npy file.