facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.59k stars 7.5k forks source link

Getting started commands to test not working! #4106

Open hiroto01 opened 2 years ago

hiroto01 commented 2 years ago

As given in the documentation i used the following command-


cd demo/
python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
  --input input1.jpg input2.jpg \
  [--other-options]
  --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

the command i used- python3 demo/demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --webcam --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

error i got-

 File "/usr/local/lib/python3.7/site-packages/detectron2/config/config.py", line 45, in merge_from_file
    assert PathManager.isfile(cfg_filename), f"Config file '{cfg_filename}' does not exist!"
AssertionError: Config file '../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' does not exist!

not understanding why this error also, why i did python3 instead of python is because-

python demo/demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --webcam --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl

error- ImportError: dlopen(/opt/homebrew/Caskroom/miniforge/base/envs/detectron/lib/python3.9/site-packages/pycocotools/_mask.cpython-39-darwin.so, 0x0002): tried: '/opt/homebrew/Caskroom/miniforge/base/envs/detectron/lib/python3.9/site-packages/pycocotools/_mask.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_mask.cpython-39-darwin.so' (no such file), '/usr/lib/_mask.cpython-39-darwin.so' (no such file)

Alexander-Weinberg commented 1 year ago

I have the same issue

Estrellas314 commented 3 weeks ago

how can I solve this problem