无法在 Docker 图像中安装 tensorflow v1 Python 包

Unable to install tensorflow v1 Python package in Docker image

我正在尝试在 Docker 构建期间安装 tensorflow<2.0,>=1.15 pip 包。我无法构建它,并且在 pip 安装期间我的终端出现了这个错误:

 > [12/12] RUN pip3 install --no-cache-dir -r requirements.txt:                                                                                                                     
#16 0.488 ERROR: Could not find a version that satisfies the requirement tensorflow<2.0,>=1.15 (from versions: none)                                                                
#16 0.489 ERROR: No matching distribution found for tensorflow<2.0,>=1.15   

要复制错误:

Docker文件:

FROM python:3.7-slim-buster
RUN apt-get update
RUN apt-get install -y unzip
RUN apt-get install -y build-essential
RUN apt-get install -y python-all-dev
RUN apt-get install -y libexiv2-dev
RUN apt-get install -y libboost-python-dev
RUN apt-get install -y wget

COPY . /usr/src/app
WORKDIR /usr/src/app

ENV PYTHONUNBUFFERED True
RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir -r requirements.txt

requirements.txt:

tensorflow>=1.15,<2.0

我怀疑这可能与 Docker 相关。 Docker Desktop 和 Docker for Linux 之间可能存在差异。但我可能做错了什么。

你们中的一些人遇到过同样的错误吗?你是如何解决这个问题的?感谢您的任何提示。

Tensorflow 1.x 不支持 Mac M1 芯片。建议安装 Tensorflow >=2.5 on Mac M1

查看来自 Mac Tensorflow 的这些发行说明:

https://github.com/apple/tensorflow_macos/releases