Server SPEC

OS/Version CPU GPU/Version
Ubuntu-server/20.04 AMD Ryzen Threadripper PRO 5955WX A6000/515.65.01
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A6000    Off  | 00000000:41:00.0 Off |                  Off |
| 30%   57C    P0    87W / 300W |      0MiB / 49140MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

Detectron2 - Repository

Detectron2 - Colab Notebook

Detectron2 - Documentation


Install Container Using Dockerfile

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2/docker/

# Change Dockerfile
## If you Don't change this, an error be occurs.
## https://github.com/facebookresearch/detectron2/issues/4394#issuecomment-1186037669

rm Dockerfile

wget https://github.com/facebookresearch/detectron2/files/9124785/Dockerfile.txt -O Dockerfile

# https://github.com/facebookresearch/detectron2/tree/main/docker

# Build:
docker build --build-arg USER_ID=$UID -t detectron2:v0 .
# Launch (require GPUs):
docker run --gpus all -it --shm-size=8gb --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --name=detectron2 detectron2:v0

Install Container Use not Dockerfile

docker pull nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04

docker run -i -t --gpus all --shm-size 8gb --name detectron2 nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04

apt-get update && apt-get -y dist-upgrade

apt-get install -y wget git vim build-essential python3 python3-pip zip libgl1-mesa-glx libglib2.0-0

Setup in Container

# Apt Updata && Upgrade && install
apt-get update && apt-get -y dist-upgrade

apt-get install -y wget git vim build-essential python3 python3-pip zip libgl1-mesa-glx libglib2.0-0

Install package

Detectron2/INSTALL.md

Requirements

  • Linux or macOS with Python ≥ 3.7
  • PyTorch ≥ 1.8 and torchvision that matches the PyTorch installation. Install them together at pytorch.org to make sure of this
  • OpenCV is optional but needed by demo and visualization
# pip3 install package
pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu116 && pip3 install opencv-python pyyaml==5.1

# Build Detectron2 from Source
mkdir /workspace && cd /workspace
git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
python -m pip install -e detectron2

Getting Started with Detectron2

Inference Demo with Pre-trained Models