Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.39 KB

File metadata and controls

23 lines (14 loc) · 1.39 KB

This example contains the newer implementation of ResNet released by the TensorFlow team.

  1. First, download the model using:
bash get_resnet_official.sh
  1. Then run the following three commands from the root directory. Note: You may also want to print ImageNet classification, if so see the instructions here before running the third command.
python create_inference_graph.py saved_model models/resnet_official/resnet_v1_fp32_savedmodel_NHWC/1538686669 softmax_tensor  models/resnet_official/ resnet_official

python  optimize_inference_graph.py  models/resnet_official/resnet_official.pb  input_tensor  softmax_tensor  224,224,3

python dnn_to_spatial.py models/resnet_official/resnet_official_opt2.pb
  1. Follow the instructions printed to move the generated file resnetofficialopt2.scala to the Spatial apps directory and compile using Spatial

  2. Select an input .jpg image and convert it to a .csv format using the data/img_to_csv.py script. When running the Spatial Top executable, pass the .csv file as an argument.

  3. Once Spatial compilation finishes, follow these instructions to load the generated AFI to your EC2 F1 instance and run the inference. For instructions to target other devices supported by Spatial, see here.