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

ModuleNotFoundError: No module named 'detectron2.config' #91

Closed ynjiun closed 9 months ago

ynjiun commented 9 months ago

Hi, great works!

I tried to run demo as below:

python demo.py --config-file ../configs/cityscapes/convnext/mapillary_pretrain_oneformer_convnext_large_bs16_90k.yaml \
  --input ../input \
  --output ../output \
  --task $task \
  --opts MODEL.IS_TRAIN False MODEL.IS_DEMO True MODEL.WEIGHTS ../checkpoint/mapillary_pretrain_250_16_convnext_l_oneformer_cityscapes_90k.pth

And got error message as following:

Traceback (most recent call last):
  File "demo.py", line 21, in <module>
    from detectron2.config import get_cfg
ModuleNotFoundError: No module named 'detectron2.config'

I did follow the installation step by step. What am I missing? Please advise.

Thanks.

ynjiun commented 9 months ago

python -m pip install detectron2==0.6 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html

ynjiun commented 9 months ago

python3 -m pip install -U 'git+https://github.com/facebookresearch/detectron2.git@ff53992b1985b63bd3262b5a36167098e3dada02'

to fix PIL.Image.LINEAR issue: https://github.com/facebookresearch/detectron2/issues/5010

ynjiun commented 9 months ago

You can use numpy==1.23 or apply the fix to the source code.

to fix numpy has no attribute bool issue

after fixing this issue, the demo.py start running ; ))