cvat: Cannot install SAM in CVAT | macOS

Hello together,

My actions before raising this issue

I have read and followed the following instructions. CVAT, Nuclio and Servless support are installed and working. SAM in CVAT CVAT with servless support

Steps to Reproduce (for bugs)

  1. Installation of CVAT (Docker previously installed) with docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d --build
  2. Create a superuser with: docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'
  3. Logging into CVAT (checking whether everything is working) -> Works for me
  4. Nuclio installation with: sudo chmod +x nuctl-<version>-linux-amd64 sudo ln -sf $(pwd)/nuctl-<version>-linux-amd64 /usr/local/bin/nuctl
  5. Install SAM with: cd serverless && ./deploy_cpu.sh pytorch/facebookresearch/sam/nuclio/

Expected Behaviour

After the installation of SAM, the account line should actually show the status ready. Bildschirmfoto 2023-07-07 um 10 49 29

Current Behaviour

But I see this:

cd serverless && ./deploy_cpu.sh pytorch/facebookresearch/sam/nuclio/
[+] Building 1.2s (9/9) FINISHED                           docker:desktop-linux
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 418B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/openvino/ubuntu20_runtime:2022  1.2s
 => [1/4] FROM docker.io/openvino/ubuntu20_runtime:2022.3.0@sha256:0cdf91  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 66B                                           0.0s
 => CACHED [2/4] RUN apt-get update     && apt-get -y --no-install-recomm  0.0s
 => CACHED [3/4] RUN pip install --no-cache-dir opencv-python-headless pi  0.0s
 => CACHED [4/4] COPY model_loader.py shared.py /opt/nuclio/common/openvi  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:a0aa876f787609eff990b86b907ed7a096896e604dd24  0.0s
 => => naming to docker.io/library/cvat.openvino.base                      0.0s

What's Next?
  View summary of image vulnerabilities and recommendations → docker scout quickview
23.07.07 10:34:41.702                     nuctl (I) Project created {"Name": "cvat", "Namespace": "nuclio"}
./deploy_cpu.sh: line 15: shopt: globstar: invalid shell option name

Possible Solution

I have already tried to update the bash and activated the globstar option. It does not work. Instruction

Context

Your Environment

  • Git hash commit (git log -1):
git log -1
commit 4b179be1ee98caf4cc701a864ca6ec7bcecc7805 (HEAD -> develop, origin/develop, origin/HEAD)
Author: Andrey Zhavoronkov <andrey@cvat.ai>
Date:   Wed Jul 5 19:42:17 2023 +0300

    Updated CHANGELOG.md, bump version (#6426)
  • Docker version docker version (e.g. Docker 17.0.05):
Client:
 Cloud integration: v1.0.35
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:16 2023
 OS/Arch:           darwin/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.21.1 (114176)
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:52:17 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

  • Are you using Docker Swarm or Kubernetes?

Docker

  • Operating System and version (e.g. Linux, Windows, MacOS):

macOS 12.6.7

  • Code example or link to GitHub repo or gist to reproduce problem:

  • Other diagnostic information / logs:

    Logs from `cvat` container

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

I’ve finally managed to get SAM running on an M1 Max MacBook Pro. Below are a few tips to help you achieve the same:

  1. Setting Up Docker RAM:

    • I set the Docker RAM to 32GB. Though I’ve seen recommendations suggesting that 16GB is sufficient (and it is), I went with 32GB since my machine has 64GB RAM. By default, Docker is set to use 8GB, which is inadequate. The CPU limit I used was 10.
  2. Starting with Serverless Mode:

    • First, stop all docker instances:
      docker stop $(docker ps -q)
      
    • Then, start with serverless mode:
      docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d
      
  3. Install the Appropriate nuctl (1.11.24-darwin-amd64):

    • Use the following commands:
      wget https://github.com/nuclio/nuclio/releases/download/1.11.24/nuctl-1.11.24-darwin-amd64 
      mv nuctl-1.11.24-darwin-amd64  nuctl
      chmod +x nuctl
      sudo mv nuctl /usr/local/bin/
      nuctl
      
    • If you encounter the error /usr/local/bin/nuctl: cannot execute binary file, it means the installation wasn’t done correctly.
  4. Handling PyTorch Compatibility Issue:

  5. Manual Deployment Steps:

    • Avoid using deploy_cpu.sh. Instead, follow these manual deployment steps:
      cd serverless
      sudo nuctl deploy --project-name cvat --path "`pwd`/pytorch/facebookresearch/sam/nuclio/" --file "`pwd`/pytorch/facebookresearch/sam/nuclio/function.yaml" --platform local
      
  6. Resetting the Setup:

    • If you wish to start afresh, stop the Docker instance and delete the nuctl function.
      docker stop <instance id of cvat.pth.facebookresearch.sam.vit_h>
      nuctl delete function pth-facebookresearch-sam-vit-h -n nuclio
      
    • If the above doesn’t work, navigate to localhost:8070 using Chrome and manually delete the cvat function.
    • After performing the above steps, nuctl get function should return nothing.
  7. Known Issue:

    • I encountered the error below but decided to ignore it since SAM still functions correctly:
      Interaction error occurred
      I.Mat is not a constructor
      

@sawhney-medha I installed nuclio before I installed cvat. I have an Intel-based Mac.

To install nuclio, check out this guide. https://opencv.github.io/cvat/docs/administration/advanced/installation_automatic_annotation/