Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to TensorFlow 2.17.0 #426

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup Python # Set Python version
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
# Install pip and pytest
- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/requirements.txt

This comment was marked as resolved.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tensorflow == 2.13.0
tensorflow == 2.18.0
tf_keras == 2.18.0
20 changes: 10 additions & 10 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
1. Bump the version for `tensorflow-internal-macros` in the root `Cargo.toml`
1. Bump the version number in `Cargo.toml`
1. Bump the version number in `README.md`
1. Run `./test-all`
1. Inside a virtualenv, run `./test-all`. (See "Running in a virtualenv" section.)
1. Double-check that addition.py is built using the version of TensorFlow being linked against. (See "Upgrading TensorFlow" section.)
1. Run `./run-valgrind`
1. Commit and push the changes. (Push before publishing to ensure that the changes being published are up to date.)
Expand All @@ -56,12 +56,12 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
## Upgrading TensorFlow

1. Update version and tag in tensorflow-sys/build.rs
1. Update version in run-valgrind
1. Run `python examples/addition/addition.py` using the version of TensorFlow being linked against.
(Use pip in a virtualenv, see https://www.tensorflow.org/install/pip#2-create-a-virtual-environment-recommended)
1. Run `virtualenv --system-site-packages -p python3 ~/tensorflow-${TENSORFLOW_VERSION?}`
1. Run `source ~/tensorflow-${TENSORFLOW_VERSION?}/bin/activate` to activate the virtualenv
1. Run `pip install --upgrade pip`
1. Run `pip install --upgrade tensorflow==${TENSORFLOW_VERSION?}`
1. Run `python examples/addition/addition.py`
1. Run `deactivate` to exit the virtualenv
1. Update version in .github/workflow/requirements.txt
1. Inside a virtualenv using the version of TensorFlow being linked against, run `python examples/addition/addition.py`. (See "Running in a virtualenv" section.)

## Running in a virtualenv

1. If you haven't set it up, run `./create-virtualenv ${TENSORFLOW_VERSION?}`
1. Run `source ~/tensorflow-${TENSORFLOW_VERSION?}/bin/activate` to activate the virtualenv
1. Do whatever you need to do in the virtual env
1. Run `deactivate` to exit the virtualenv
7 changes: 7 additions & 0 deletions check-disk-space
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -euo pipefail

df -h || true
du -sh || true
du -sh /* || true
25 changes: 25 additions & 0 deletions create-virtualenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# See https://www.tensorflow.org/install/pip#2-create-a-virtual-environment-recommended

set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Expected first argument to be TensorFlow version"
exit 1
fi
TENSORFLOW_VERSION="$1"

function run {
echo "----------------------------------------------------------------------"
echo "Running: $@"
"$@"
echo
}

run virtualenv --system-site-packages -p python3 ~/tensorflow-${TENSORFLOW_VERSION?}
run source ~/tensorflow-${TENSORFLOW_VERSION?}/bin/activate
run pip install --upgrade pip
run pip install --upgrade tensorflow==${TENSORFLOW_VERSION?}
run pip install tf_keras # required for examples/mobilenetv3
run deactivate
Binary file modified examples/addition/model.pb
Binary file not shown.
2 changes: 0 additions & 2 deletions run-valgrind
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ function run {
echo
}

tensorflow_version=2.13.0

valgrind_log=valgrind.log
truncate --size=0 "$valgrind_log"

Expand Down
Loading
Loading