Skip to content

Getting Started process fails on M1 Mac #273

Closed
@zeke

Description

@zeke

I'm going through the Getting started guide and got an error during the build process:

The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Here's the full output:

~/git/zeke/cog-quickstart
$ /usr/local/bin/cog predict -i @input.jpg
Building Docker image from environment in cog.yaml...
[+] Building 114.9s (13/13) FINISHED                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                                     0.0s
 => => transferring dockerfile: 592B                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                          0.0s
 => resolve image config for docker.io/docker/dockerfile:1.2                                                                                             0.5s
 => CACHED docker-image://docker.io/docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc                        0.0s
 => [internal] load metadata for docker.io/library/python:3.8                                                                                            0.5s
 => [internal] load build context                                                                                                                        0.0s
 => => transferring context: 13.68kB                                                                                                                     0.0s
 => CACHED [stage-0 1/5] FROM docker.io/library/python:3.8@sha256:0f594721ed51e1cccd5881f979a7b42ee7109d22749d246fc41d0e3ef4a52ba1                       0.0s
 => [stage-0 2/5] COPY .cog/tmp/build1291097786/cog-0.0.1.dev-py3-none-any.whl /tmp/cog-0.0.1.dev-py3-none-any.whl                                       0.0s
 => [stage-0 3/5] RUN --mount=type=cache,target=/root/.cache/pip pip install /tmp/cog-0.0.1.dev-py3-none-any.whl                                        12.0s
 => [stage-0 4/5] RUN --mount=type=cache,target=/root/.cache/pip pip install   pillow==8.3.1 tensorflow==2.5.0                                          98.9s
 => [stage-0 5/5] WORKDIR /src                                                                                                                           0.0s 
 => exporting to image                                                                                                                                   0.0s 
 => => exporting layers                                                                                                                                  0.0s 
 => => writing image sha256:40550d31a34c727e5c7941673e7ee90cf6b155178c3d4bb03d6b9737117bad92                                                             0.0s 
 => => naming to docker.io/library/cog-cog-quickstart-base                                                                                               0.0s 
 => exporting cache                                                                                                                                      0.0s 
 => => preparing build cache for export                                                                                                                  0.0s

Starting Docker image cog-cog-quickstart-base and running setup()...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
2021-09-29 17:45:33.092137: F tensorflow/core/lib/monitoring/sampler.cc:42] Check failed: bucket_limits_[i] > bucket_limits_[i - 1] (0 vs. 10)
qemu: uncaught target signal 6 (Aborted) - core dumped
^C

I saw I was behind a few versions (current latest is 0.0.13):

$ /usr/local/bin/cog --version            
cog version 0.0.11 (built 2021-09-13T18:48:30Z)

So I attempted to upgrade to the latest cog:

$ sudo curl -o /usr/local/bin/cog -L https://github.com/replicate/cog/releases/latest/download/cog_`uname -s`_`uname -m`
sudo chmod +x /usr/local/bin/cog

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   141  100   141    0     0    594      0 --:--:-- --:--:-- --:--:--   592
100   624  100   624    0     0   1444      0 --:--:-- --:--:-- --:--:--  1444
100 8256k  100 8256k    0     0  9225k      0 --:--:-- --:--:-- --:--:-- 9225k

But the latest release seems to be corrupted or something:

$ /usr/local/bin/cog --version                                                                                          
zsh: killed     /usr/local/bin/cog --version

$ echo "https://github.com/replicate/cog/releases/latest/download/cog_`uname -s`_`uname -m`"                      
https://github.com/replicate/cog/releases/latest/download/cog_Darwin_arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions