Skip to content

Commit

Permalink
[Docker] Updated tensorflow/tflite version to 2.4.2
Browse files Browse the repository at this point in the history
Tensorflow update required following update to cuda 11.0.  Based on
https://www.tensorflow.org/install/source#gpu, the 2.4 branch of
tensorflow should be used with cuda 11.0.

- Removed pinned version of keras/h5py, no longer needed.

  tensorflow/tensorflow#44467 (comment)

- Updated tflite version to 2.4.2.  Also, tflite install script now
  reads the installed version of tensorflow, to keep the version
  matched in the future.
  • Loading branch information
Lunderberg committed Jun 22, 2021
1 parent 2acfa2c commit b3f90ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -234,6 +234,9 @@ conda/pkg
.envrc
*.nix

# Docker files
.sudo_as_admin_successful

# Downloaded models/datasets
.tvm_test_data
.dgl
Expand Down
5 changes: 1 addition & 4 deletions docker/install/ubuntu_install_tensorflow.sh
Expand Up @@ -20,7 +20,4 @@ set -e
set -u
set -o pipefail

# h5py is pinned to minor than 3 due to issues with
# tensorflow:
# https://github.com/tensorflow/tensorflow/issues/44467
pip3 install tensorflow==2.3.1 keras==2.4.3 "h5py<3.0"
pip3 install tensorflow==2.4.2
10 changes: 7 additions & 3 deletions docker/install/ubuntu_install_tflite.sh
Expand Up @@ -20,6 +20,10 @@ set -e
set -u
set -o pipefail

# The tflite version should have matched versions to the tensorflow
# version installed from pip in ubuntu_install_tensorflow.sh
TENSORFLOW_VERSION=$(python3 -c "import tensorflow; print(tensorflow.__version__)" 2> /dev/null)

# Download, build and install flatbuffers
git clone --branch=v1.12.0 --depth=1 --recursive https://github.com/google/flatbuffers.git
cd flatbuffers
Expand All @@ -33,22 +37,22 @@ pip3 install flatbuffers
# Build the TFLite static library, necessary for building with TFLite ON.
# The library is built at:
# tensorflow/tensorflow/lite/tools/make/gen/*/lib/libtensorflow-lite.a.
git clone https://github.com/tensorflow/tensorflow --branch=r2.3
git clone https://github.com/tensorflow/tensorflow --branch=v${TENSORFLOW_VERSION}
./tensorflow/tensorflow/lite/tools/make/download_dependencies.sh
./tensorflow/tensorflow/lite/tools/make/build_lib.sh

# Setup tflite from schema
mkdir tflite
cp tensorflow/tensorflow/lite/schema/schema.fbs tflite
cd tflite
wget -q https://raw.githubusercontent.com/tensorflow/tensorflow/r2.3/tensorflow/lite/schema/schema.fbs
flatc --python schema.fbs

cat <<EOM >setup.py
import setuptools
setuptools.setup(
name="tflite",
version="2.3.1",
version="${TENSORFLOW_VERSION}",
author="google",
author_email="google@google.com",
description="TFLite",
Expand Down

0 comments on commit b3f90ab

Please sign in to comment.