worldveil / photomosaic

Creating fun photomosaics, GIFs, and murals from your family pictures using ML & similarity search
645 stars 60 forks source link

Unable to build.sh on Mac Catalina #17

Open jzarka opened 2 years ago

jzarka commented 2 years ago

I'm having the following issue when trying to build.sh the library.

$ sh build.sh [+] Building 1.5s (8/12) => [internal] load build definition from Dockerfile.cpu 0.0s => => transferring dockerfile: 1.46kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 34B 0.0s => [internal] load metadata for docker.io/nvidia/cuda:8.0-devel-ubuntu16.04 1.2s => [internal] load build context 0.0s => => transferring context: 38B 0.0s => [1/8] FROM docker.io/nvidia/cuda:8.0-devel-ubuntu16.04@sha256:c4d900990dff990d3deeb0e0d9f665f094628d45990f1dd766e02863583 0.0s => CACHED [2/8] RUN apt-get update && apt-get install -y curl bzip2 libgl1-mesa-glx 0.0s => CACHED [3/8] RUN curl https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh > /tmp/conda.sh 0.0s => ERROR [4/8] RUN bash /tmp/conda.sh -b -p /opt/conda && /opt/conda/bin/conda update -n base conda && /opt/conda/bi 0.2s

[4/8] RUN bash /tmp/conda.sh -b -p /opt/conda && /opt/conda/bin/conda update -n base conda && /opt/conda/bin/conda install -y -c pytorch faiss-cpu=1.3.0 && apt-get remove -y --auto-remove curl bzip2 && apt-get clean && rm -fr /tmp/conda.sh:

7 0.231 /bin/sh: 1: /opt/conda/bin/conda: not found


executor failed running [/bin/sh -c bash /tmp/conda.sh -b -p /opt/conda && /opt/conda/bin/conda update -n base conda && /opt/conda/bin/conda install -y -c pytorch faiss-${FAISS_CPU_OR_GPU}=${FAISS_VERSION} && apt-get remove -y --auto-remove curl bzip2 && apt-get clean && rm -fr /tmp/conda.sh]: exit code: 127 (base)

I have properly installed Docker and XQuartz. Trying to solve this issue, I've also tried to install conda on my machine and to adapt the Dockerfile.cpu, with no luck.

Would you please kindly assist?

eugenejeonme commented 2 years ago

You needs add --platform options in Dockerfile.cpu, like this.

image
Abdull commented 1 year ago

Because of /bin/sh: 1: /opt/conda/bin/conda: not found, I have the feeling that this issue is a duplicate of https://github.com/worldveil/photomosaic/issues/15 . Have a look at the solutions over there.

LanesGood commented 1 year ago

I'm also on an Apple M1 chip machine, running Mac OS Monterey v12.6 and ran into the same issues described above.

PROBLEM 1

First, I figured out that nvidia/cuda:8.0 is EOL and the image is down https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/support-policy.md

SOLUTION

I was able to get the first steps of the build script running with FROM nvidia/cuda:11.8.0-devel-ubuntu22.04, which is the latest nvidia/cuda image at the time of writing. (Checked latest tags at https://hub.docker.com/r/nvidia/cuda/tags)

PROBLEM 2

I then ran into the same issue at step [4/8] as @jzarka did above. I assumed that M1 chip compatibility issues with the miniconda2 version could also be to blame. I first tried subbing in M1/ARM-compatable versions of conda from https://repo.anaconda.com/miniconda/, but this didn't solve the problem.

SOLUTION

I used the --platform=linux/amd64 tag as suggested by @eugenejeonme above. This seemed to move things along

PROBLEM 3

After over 3,000 seconds of build time (about 50 minutes!), the build failed on step [6/8] with the error Package 'python-dev' has no installation candidate. The script suggested the following replacement packages python2-dev python2 python-dev-is-python3.

SOLUTION

I replaced python-dev with python2-dev and restarted the build script. Luckily the previously run scripts were cached and it kicked right off from step [6/8], which was successful.

And... YES the build step worked! 2318.7s for the second run, so almost an hour and a half overall just on combined build time.

I'll open a PR with my changes