Skip to content

Instantly share code, notes, and snippets.

@petewarden
Created March 10, 2016 22:32
Show Gist options
  • Save petewarden/c57f79a32ea3c19eff4d to your computer and use it in GitHub Desktop.
Save petewarden/c57f79a32ea3c19eff4d to your computer and use it in GitHub Desktop.
mkdir ~/projects
cd ~/projects
git clone --recurse-submodules https://github.com/petewarden/tensorflow_ios.git tensorflow_ios
cd tensorflow_ios
mkdir tools
mkdir tools/objc
echo '
filegroup(
name = "default_provisioning_profile",
srcs = ["default_provisioning_profile.mobileprovision"],
visibility = ["//visibility:public"],
)' > tools/objc/BUILD
echo >> tools/objc/default_provisioning_profile.mobileprovision
cd ~/projects
git clone https://github.com/petewarden/bazel bazel_pw
cd bazel_pw
./compile.sh
cd ~/projects
git clone https://github.com/petewarden/re2.git re2_pw
git clone https://github.com/petewarden/protobuf.git protobuf_pw
cd tensorflow_ios
cp ../protobuf_pw/BUILD google/protobuf/
mkdir tensorflow/examples/ios/data
wget http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz -O /tmp/inception-v3.tgz
tar xzf /tmp/inception-v3.tgz -C tensorflow/examples/ios/data/
wget https://upload.wikimedia.org/wikipedia/commons/5/55/Grace_Hopper.jpg -O tensorflow/examples/ios/data/grace_hopper.jpg
mv tensorflow/examples/ios/data/imagenet_synset_to_human_label_map.txt tensorflow/examples/ios/data/imagenet_comp_graph_label_strings.txt
mv tensorflow/examples/ios/data/classify_image_graph_def.pb tensorflow/examples/ios/data/tensorflow_inception_graph.pb
bazel build -c opt -s //tensorflow/examples/ios:ios-app-binary-cc --ios_sdk_version=9.2 --ios_cpu="arm64" --verbose_failures --logging=6
sed -E 's/^.*size =.*$//' ../re2_pw/BUILD > bazel-tensorflow_ios/external/re2/BUILD
bazel build -c opt -s //tensorflow/examples/ios:ios-app-binary-cc --ios_sdk_version=9.2 --ios_cpu="arm64" --verbose_failures --logging=6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment