BirdNET-Analyzer
BirdNET-Analyzer copied to clipboard
Docker Build Failure
I'm trying to build birdnet on docker.
I am using the following: [1] Mac Mini M1 with macOS Monterey version 12.3.1, [2] Docker Desktop version 4.7.1 (77678)
The error I'm getting is below:
=> ERROR [4/5] RUN pip3 install tensorflow 0.7s
[4/5] RUN pip3 install tensorflow: #8 0.640 ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) #8 0.640 ERROR: No matching distribution found for tensorflow
executor failed running [/bin/sh -c pip3 install tensorflow]: exit code: 1
Well, I noticed a comment on the main git page: "Install TFLite runtime (recommended) or Tensorflow (has to be 2.5 or later):"
Since it's saying tflite-runtime is "recommended", I edited the "Dockerfile" file and changed it to:
Install tflite-runtime
RUN pip3 install tflite-runtime
The build succeeded (see below).
[+] Building 7.5s (11/11) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 499B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/python:3.8-slim 0.8s => [auth] library/python:pull token for registry-1.docker.io 0.0s => [1/5] FROM docker.io/library/python:3.8-slim@sha256:92331358d341594de3857397796335d6e1e26fca1230709e439a415624792c87 0.0s => [internal] load build context 0.0s => => transferring context: 8.49kB 0.0s => CACHED [2/5] RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/* 0.0s => CACHED [3/5] RUN pip3 install numpy scipy librosa 0.0s => [4/5] RUN pip3 install tflite-runtime 1.2s => [5/5] COPY . ./ 3.1s => exporting to image 2.2s => => exporting layers 2.2s => => writing image sha256:4e3e123797bd2eaf23c097b7aeecb3e163482c10f6907ed64fbc73c55f9c538a 0.0s => => naming to docker.io/library/birdnet
Thanks! Not sure why it wouldn't work with TF, seems like it is expecting a certain Python environment, but the container should typically provide the correct one. However, like you said, since pip install tflite-runtime also works, I'll update the docker file to use the runtime instead.
I run into this problem a lot because I'm using an Mac Mini M1 which is NOT Intel. However, I'm just guessing that's the issue here. On a lot of Docker builds, I run into issues of packages NOT working because it's arm64 (Apple Silicon).
I'm closing this ticket because the mentioned changes were made.
Just as a note, maybe it's also worth to incorporate this in the Dockerfile.