Docker错误:找不到满足tensorflow cpu要求的版本



我正在尝试构建一个docker映像,当docker构建达到tensorflow cpu要求时,我得到以下错误:

ERROR: Could not find a version that satisfies the requirement tensorflow-cpu (from socialworks-nn==0.0.7->-r requirements.txt (line 16)) (from versions: none)
ERROR: No matching distribution found for tensorflow-cpu (from socialworks-nn==0.0.7->-r requirements.txt (line 16))

这是我的Dockerfile:

FROM python:3.6-alpine3.7
RUN apk add --no-cache python3-dev 
&& pip3 install --upgrade pip
RUN apk --no-cache add git
RUN apk add mariadb-dev
WORKDIR /socialworks-api
COPY . /socialworks-api
RUN pip3 --no-cache-dir install -r requirements.txt

我可以问一下我应该运行什么来安装tensorflow吗?我的应用程序必须在Python 3.6上运行。我是Docker的新手,这是我的第一个版本。此外,我已经尝试过对tensorflow进行注释,但我收到了与numpy相同的错误。

我也试过在Dockerfile:中运行这个命令

RUN python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl

但在那之后,我会收到这个错误:

ERROR: tensorflow_gpu-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl is not a supported wheel on this platform.

所以问题是为了安装tensorflow cpu,我需要使用FROM tensorflow/tensorflow:2.1.0-py3FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04但使用其中一个,图像的大小会变得非常大。

最新更新