From b7b0761566a18dac0f4e57f22854d3ec75603515 Mon Sep 17 00:00:00 2001 From: Leslie-Fang Date: Sun, 26 Apr 2020 03:48:51 +0800 Subject: [PATCH] fix tflite python whl package pybind11 build fail --- tensorflow/lite/tools/pip_package/README.md | 1 + tensorflow/lite/tools/pip_package/setup.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/tools/pip_package/README.md b/tensorflow/lite/tools/pip_package/README.md index dac8ce02ca1..0a73bb364e5 100644 --- a/tensorflow/lite/tools/pip_package/README.md +++ b/tensorflow/lite/tools/pip_package/README.md @@ -9,6 +9,7 @@ To build a binary wheel run this script: ```sh sudo apt install swig libjpeg-dev zlib1g-dev python3-dev python3-numpy +pip install numpy pybind11 sh tensorflow/lite/tools/make/download_dependencies.sh sh tensorflow/lite/tools/pip_package/build_pip_package.sh ``` diff --git a/tensorflow/lite/tools/pip_package/setup.py b/tensorflow/lite/tools/pip_package/setup.py index 2f2515145c4..d5e779435e7 100644 --- a/tensorflow/lite/tools/pip_package/setup.py +++ b/tensorflow/lite/tools/pip_package/setup.py @@ -33,6 +33,7 @@ import sysconfig from distutils.command.build_ext import build_ext import numpy +import pybind11 from setuptools import Extension from setuptools import find_packages @@ -178,8 +179,9 @@ ext = Extension( 'pip_package'), numpy.get_include(), os.path.join(DOWNLOADS_DIR, 'flatbuffers', 'include'), - os.path.join(DOWNLOADS_DIR, 'absl') - ] + get_pybind_include(), + os.path.join(DOWNLOADS_DIR, 'absl'), + pybind11.get_include() + ], libraries=[LIB_TFLITE], library_dirs=[LIB_TFLITE_DIR])