Skip to content

Instantly share code, notes, and snippets.

@ayaka14732
Last active April 15, 2022 15:39
Show Gist options
  • Save ayaka14732/4954f64b7246beafabb45b636d96e92a to your computer and use it in GitHub Desktop.
Save ayaka14732/4954f64b7246beafabb45b636d96e92a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
set -v
sudo rm -rf ~/.cache/bazel # clear bazel cache (see tensorflow#55563)
export TENSORFLOW_SHA=0d5668cbdc6b46d099bd3abd93374c09b2e8121f
wget https://github.com/tensorflow/tensorflow/archive/$TENSORFLOW_SHA.tar.gz
tar zxf $TENSORFLOW_SHA.tar.gz
rm -f $TENSORFLOW_SHA.tar.gz
mv tensorflow-$TENSORFLOW_SHA tensorflow
cd tensorflow
export BAZEL_VERSION=`cat .bazelversion`
sudo mkdir -p /usr/local/lib/bazel/bin
sudo wget -nc -P /usr/local/lib/bazel/bin https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-x86_64
sudo chmod +x /usr/local/lib/bazel/bin/bazel-$BAZEL_VERSION-linux-x86_64
rm -rf ~/.venv310
python3.10 -m venv ~/.venv310
. ~/.venv310/bin/activate
pip install -U wheel packaging
pip install -U keras_preprocessing --no-deps
pip install "jax[tpu]==0.3.6" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
yes '' | python configure.py # use the default settings
bazel build --config=tpu //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
ls /tmp/tensorflow_pkg/tensorflow-*.whl
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment