Skip to content

Commit 58e11a4

Browse files
terryheotflite-support-robot
authored andcommitted
Update Python wheel build rules
$ make -C tensorflow_lite_support/tools/pip_package/rpi docker-build PYTHON_VERSION="3.10" PiperOrigin-RevId: 546776675
1 parent f37a98e commit 58e11a4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tensorflow_lite_support/tools/pip_package/rpi/Dockerfile.py3

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
ARG IMAGE
1616
FROM ${IMAGE}
1717
ARG PYTHON_VERSION
18+
ARG NUMPY_VERSION
1819

1920
COPY update_sources.sh /
2021
RUN /update_sources.sh
2122

2223
RUN apt-get update && \
24+
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \
2325
apt-get install -y \
2426
build-essential \
2527
software-properties-common \
@@ -30,7 +32,6 @@ RUN apt-get update && \
3032
xxd && \
3133
apt-get clean
3234

33-
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
3435
# Install Python packages.
3536
RUN dpkg --add-architecture armhf
3637
RUN dpkg --add-architecture arm64
@@ -53,7 +54,7 @@ RUN curl -OL https://bootstrap.pypa.io/get-pip.py
5354
RUN python3 get-pip.py
5455
RUN rm get-pip.py
5556
RUN pip3 install --upgrade pip
56-
RUN pip3 install numpy~=1.20.0 setuptools pybind11
57+
RUN pip3 install numpy~=$NUMPY_VERSION setuptools pybind11
5758
RUN ln -sf /usr/include/python$PYTHON_VERSION /usr/include/python3
5859
RUN ln -sf /usr/local/lib/python$PYTHON_VERSION/dist-packages/numpy/core/include/numpy /usr/include/python3/numpy
5960
RUN ln -sf /usr/bin/python3 /usr/bin/python

tensorflow_lite_support/tools/pip_package/rpi/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Values: debian:<version>, ubuntu:<version>
1616
BASE_IMAGE ?= ubuntu:20.04
1717
PYTHON_VERSION ?= 3.9
18+
NUMPY_VERSION ?= 1.21.2
1819

1920
# Nightly flag for build_arm_pip_package.sh
2021
NIGHLTY_FLAG ?= --nightly_flag
@@ -46,7 +47,11 @@ help:
4647
@echo "make clean -- remove wheel and deb files"
4748

4849
docker-image:
49-
docker build -t $(TAG_IMAGE) --build-arg IMAGE=$(BASE_IMAGE) --build-arg PYTHON_VERSION=$(PYTHON_VERSION) -f $(MAKEFILE_DIR)/Dockerfile.py3 $(MAKEFILE_DIR)/.
50+
docker build -t $(TAG_IMAGE) \
51+
--build-arg IMAGE=$(BASE_IMAGE) \
52+
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
53+
--build-arg NUMPY_VERSION=$(NUMPY_VERSION) \
54+
-f $(MAKEFILE_DIR)/Dockerfile.py3 $(MAKEFILE_DIR)/.
5055

5156
docker-shell: docker-image
5257
mkdir -p $(WORKSPACE_DIR)/bazel-ci_build-cache

0 commit comments

Comments
 (0)