diff --git a/README.md b/README.md index 2af2fc6..87087de 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,24 @@ apt-get install libpython-all-dev:armhf # For python3 apt-get install libpython3-all-dev:armhf ``` -Using Docker +### Using Docker + +#### Python 3.7 + ```shell cd build_tensorflow/ docker build -t tf-arm -f Dockerfile . docker run -it -v /tmp/tensorflow_pkg/:/tmp/tensorflow_pkg/ --env TF_PYTHON_VERSION=3.7 tf-arm ./build_tensorflow.sh configs/ # rpi.conf, rk3399.conf ... ``` +#### Python 3.8 + +```shell +cd build_tensorflow/ +docker build -t tf-arm -f Dockerfile.bullseye . +docker run -it -v /tmp/tensorflow_pkg/:/tmp/tensorflow_pkg/ --env TF_PYTHON_VERSION=3.8 tf-arm ./build_tensorflow.sh configs/ # rpi.conf, rk3399.conf ... +``` + ## Edit tweaks like Bazel resources, board model, and others. See configuration file examples in: build_tensorflow/configs/ diff --git a/build_tensorflow/Dockerfile.bullseye b/build_tensorflow/Dockerfile.bullseye new file mode 100644 index 0000000..6940a5f --- /dev/null +++ b/build_tensorflow/Dockerfile.bullseye @@ -0,0 +1,31 @@ +FROM debian:bullseye + +RUN dpkg --add-architecture armhf && dpkg --add-architecture arm64 \ + && apt-get update && apt-get install -y \ + openjdk-11-jdk automake autoconf libpng-dev \ + curl zip unzip libtool swig zlib1g-dev pkg-config git wget xz-utils \ + python3-pip python3-mock \ + libpython3-dev libpython3-all-dev \ + libpython3-dev:armhf libpython3-all-dev:armhf \ + libpython3-dev:arm64 libpython3-all-dev:arm64 + +RUN pip install "numpy<1.19.0" + +# NOTE: forcing gcc 8.3 as default (prevents internal compiler error: in emit_move_insn, at expr.c bug in gcc-6 of stretch) +RUN echo "deb http://ftp.us.debian.org/debian/ buster main contrib non-free" > /etc/apt/sources.list.d/buster.list \ + && apt-get update && apt-get install -y --allow-downgrades gcc-8 g++-8 gcc=4:8.3.0-1 g++=4:8.3.0-1 cpp=4:8.3.0-1\ + && rm -f /etc/apt/sources.list.d/buster.list \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install -U --user keras_applications==1.0.8 --no-deps \ + && pip3 install -U --user keras_preprocessing==1.1.0 --no-deps \ + && ldconfig + +RUN /bin/bash -c "update-alternatives --install /usr/bin/python python /usr/bin/python3 150" + +WORKDIR /root +RUN git clone https://github.com/lhelontra/tensorflow-on-arm/ + +WORKDIR /root/tensorflow-on-arm/build_tensorflow/ +RUN git checkout v2.3.0 +CMD ["/bin/bash"]