From a5d33e60e7484b552c9df0d88ce896c3342dd176 Mon Sep 17 00:00:00 2001 From: SRK Reddy Date: Fri, 4 Jan 2019 21:13:50 +0530 Subject: [PATCH 1/2] [TFLite] CI recipe. --- docker/Dockerfile.ci_gpu | 3 +++ docker/install/ubuntu_install_tflite.sh | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 docker/install/ubuntu_install_tflite.sh diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu index 708331d3d61a..5ec9820522e9 100644 --- a/docker/Dockerfile.ci_gpu +++ b/docker/Dockerfile.ci_gpu @@ -57,6 +57,9 @@ RUN bash /install/ubuntu_install_darknet.sh COPY install/ubuntu_install_onnx.sh /install/ubuntu_install_onnx.sh RUN bash /install/ubuntu_install_onnx.sh +COPY install/ubuntu_install_tflite.sh /install/ubuntu_install_tflite.sh +RUN bash /install/ubuntu_install_tflite.sh + RUN pip3 install Pillow COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh diff --git a/docker/install/ubuntu_install_tflite.sh b/docker/install/ubuntu_install_tflite.sh new file mode 100644 index 000000000000..ad4a37b0293b --- /dev/null +++ b/docker/install/ubuntu_install_tflite.sh @@ -0,0 +1,8 @@ +#install the necessary dependancies for tflite +pip3 install flatbuffers +pip2 install flatbuffers + +wget https://github.com/dmlc/web-data/raw/master/tensorflow/tflite/whl/tflite-0.0.1-py2-none-any.whl +wget https://github.com/dmlc/web-data/raw/master/tensorflow/tflite/whl/tflite-0.0.1-py3-none-any.whl +pip2 install tflite-0.0.1-py2-none-any.whl +pip3 install tflite-0.0.1-py3-none-any.whl From 2c32b2e921c97e71b96af2784a881ea9f5500232 Mon Sep 17 00:00:00 2001 From: SRK Reddy Date: Wed, 9 Jan 2019 22:10:08 +0530 Subject: [PATCH 2/2] * Custom bake tflite package and install. --- docker/install/ubuntu_install_tflite.sh | 51 ++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/docker/install/ubuntu_install_tflite.sh b/docker/install/ubuntu_install_tflite.sh index ad4a37b0293b..97235c4644f5 100644 --- a/docker/install/ubuntu_install_tflite.sh +++ b/docker/install/ubuntu_install_tflite.sh @@ -1,8 +1,49 @@ -#install the necessary dependancies for tflite +# Download, build and install flatbuffers +git clone --recursive https://github.com/google/flatbuffers.git +cd flatbuffers +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release +make install -j8 +cd .. +rm -rf flatbuffers + +# Install flatbuffers python packages. pip3 install flatbuffers pip2 install flatbuffers -wget https://github.com/dmlc/web-data/raw/master/tensorflow/tflite/whl/tflite-0.0.1-py2-none-any.whl -wget https://github.com/dmlc/web-data/raw/master/tensorflow/tflite/whl/tflite-0.0.1-py3-none-any.whl -pip2 install tflite-0.0.1-py2-none-any.whl -pip3 install tflite-0.0.1-py3-none-any.whl +# Setup tflite from schema +mkdir tflite +cd tflite +wget https://raw.githubusercontent.com/tensorflow/tensorflow/r1.12/tensorflow/contrib/lite/schema/schema.fbs +flatc --python schema.fbs + +cat <setup.py +import setuptools + +setuptools.setup( + name="tflite", + version="0.0.1", + author="google", + author_email="google@google.com", + description="TFLite", + long_description="TFLite", + long_description_content_type="text/markdown", + url="https://www.tensorflow.org/lite", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 2", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], +) +EOM + +cat <__init__.py +name = "tflite" +EOM + +# Install tflite over python2 and python3 +python3 setup.py install +python2 setup.py install + +cd .. +rm -rf tflite