0
votes

I'm trying to build an image using DockerFile in AmazonSageMaker but I'm getting the following error.

Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in from pip import main ImportError: cannot import name 'main' The command '/bin/sh -c pip3 install --upgrade pip setuptools wheel &&
pip3 install mxnet-cu90 --upgrade --pre && pip3 install keras-mxnet --upgrade --pre' returned a non-zero code: 1

My DockerFile is as below

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

1 Answers

0
votes

you can run a container use image nvidia/cuda:9.0-runtime, try pip install command in the container and see what the command return