Quantize Neural Networks
-
curl http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz -o /tmp/inceptionv3.tgz tar xzf /tmp/inceptionv3.tgz -C /tmp/ bazel build tensorflow/tools/quantization/tools:quantize_graph bazel-bin/tensorflow/tools/quantization/tools/quantize_graph \ --input=/tmp/classify_image_graph_def.pb \ --output_node_names="softmax" --output=/tmp/quantized_graph.pb \ --mode=eightbit
-
bazel build tensorflow/examples/label_image:label_image bazel-bin/tensorflow/examples/label_image/label_image \ --image=<input-image> \ --graph=/tmp/quantized_graph.pb \ --labels=/tmp/imagenet_synset_to_human_label_map.txt \ --input_width=299 \ --input_height=299 \ --input_mean=128 \ --input_std=128 \ --input_layer="Mul:0" \ --output_layer="softmax:0"
- Song Han's code books
- https://github.com/google/gemmlowp