Skip to content

Instantly share code, notes, and snippets.

grep 'REGISTER.*"Mul"' tensorflow/core/kernels/*.cc
bazel run tensorflow/tools/graph_transforms:transform_graph -- \
--in_graph=tensorflow_inception_graph.pb \
--out_graph=optimized_inception_graph.pb --inputs='Mul' \
--outputs='softmax' --transforms='strip_unused_nodes(type=float, shape="1,299,299,3") fold_constants(ignore_errors=true) fold_batch_norms fold_old_batch_norms'
bazel run tensorflow/tools/graph_transforms:summarize_graph -- \
--in_graph=tensorflow_inception_graph.pb
bazel build tensorflow/python/tools:freeze_graph
bazel-bin/tensorflow/python/tools/freeze_graph \
--input_graph=/tmp/model/my_graph.pb \
--input_checkpoint=/tmp/model/model.ckpt-1000 \
--output_graph=/tmp/frozen_graph.pb \
--input_node_names=input_node \
--output_node_names=output_node
tensorflow/contrib/makefile/download_dependencies.sh
tensorflow/contrib/makefile/rename_protobuf.sh
curl https://storage.googleapis.com/download.tensorflow.org/models/inception_dec_2015_stripped.zip \
-o /tmp/inception_dec_2015_stripped.zip
unzip /tmp/inception_dec_2015_stripped.zip \
-d tensorflow/contrib/pi_examples/label_image/data/
make -f tensorflow/contrib/makefile/Makefile HOST_OS=PI \
TARGET=PI OPTFLAGS="-Os -mfpu=neon-vfpv4 \
-funsafe-math-optimizations -ftree-vectorize" CXX=g++-4.8
make -f tensorflow/contrib/makefile/Makefile HOST_OS=PI \
TARGET=PI OPTFLAGS="-Os" CXX=g++-4.8
tensorflow/contrib/makefile/download_dependencies.sh
sudo apt-get install -y \
autoconf automake libtool gcc-4.8 g++-4.8
cd tensorflow/contrib/makefile/downloads/protobuf/
./autogen.sh
./configure
make
sudo make install
sudo ldconfig # refresh shared library cache
cd ../../../../..
mkdir -p ~/graphs
curl -o ~/graphs/inception5h.zip \
https://storage.googleapis.com/download.tensorflow.org/ \
models/inception5h.zip
unzip ~/graphs/inception5h.zip -d ~/graphs/inception5h
cp ~/graphs/inception5h/* \
tensorflow/examples/ios/benchmark/data/
cp ~/graphs/inception5h/* \
tensorflow/examples/ios/camera/data/
cp ~/graphs/inception5h/* \