Dockerfile返回非零代码:1

时间:2018-08-15 01:30:53

标签: python docker keras

我正在尝试使用AmazonSageMaker中的DockerFile构建映像,但是出现以下错误。

  

回溯(最近通话最近):
  文件“ / usr / bin / pip3”,第9行,在          从pip导入main ImportError:无法导入名称'main'命令'/ bin / sh -c pip3 install --upgrade pip setuptools wheel &&
  pip3 install mxnet-cu90-升级--pre && pip3安装   keras-mxnet --upgrade --pre'返回了一个非零代码:1

我的DockerFile如下

FROM nvidia/cuda:9.0-runtime

RUN apt-get update && \
    apt-get -y install build-essential libopencv-dev libopenblas-dev libjemalloc-dev libgfortran3 \
    python-dev python3-dev python3-pip wget curl

COPY train_siamese_network.py /opt/program/train RUN chmod +x /opt/program/train

RUN mkdir /root/.keras COPY keras.json /root/.keras/

RUN pip3 install --upgrade pip setuptools wheel && \
    pip3 install mxnet-cu90 --upgrade --pre && \
    pip3 install keras-mxnet --upgrade --pre

RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /root/.cache

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

ENV PATH="/opt/program:${PATH}"

WORKDIR /opt/program

1 个答案:

答案 0 :(得分:0)

您可以使用映像nvidia / cuda:9.0-runtime运行容器,尝试在容器中使用pip install命令并查看命令返回的内容