SHI-Labs / OneFormer

OneFormer: One Transformer to Rule Universal Image Segmentation, arxiv 2022 / CVPR 2023
https://praeclarumjj3.github.io/oneformer
MIT License
1.39k stars 129 forks source link

Installation and setting up this repo is challenging #94

Closed Pari-singh closed 9 months ago

Pari-singh commented 9 months ago

Installation could be challenging for this repo if someone has nvidia driver not supporting cuda 11.3. make.sh failed in my (22.04 machine) as it had 11.5 toolkit version by default but downloading any else fails. One quick hack is to install conda cuda_toolkit-dev=11.3 as dev installs nvcc support for toolkit 11.3. This also resolves mismatch issue. Another issue which I faced was once we are done with installation, calling detectron2.config file still throws error as the installation step only adds the script for that particular session. I had to go into the folder and run pip install -e . For the Dockerfile provided by Huggingface, I had to add RUN pip install uvicorn before install requirements.txt file as gradio (which is not a much needed pack if you don't wanna run the api) installs incorrect uvicorn which causes several package clashes with other modules in requirements.py.

huydung179 commented 7 months ago

it works for me with this installation:

conda create --name oneformer python=3.10 -y
conda activate oneformer

git clone https://github.com/SHI-Labs/OneFormer.git
cd OneFormer

# Install Pytorch
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=12.1 -c pytorch -c nvidia

# Install opencv (required for running the demo)
pip3 install -U opencv-python

# Install detectron2
python3 -m pip install 'git+https://github.com/facebookresearch/detectron2.git'

# Install other dependencies
pip3 install git+https://github.com/cocodataset/panopticapi.git
pip3 install git+https://github.com/mcordts/cityscapesScripts.git
pip3 install -r requirements.txt