aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.37k stars 646 forks source link

UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown len(cache)) #339

Closed zeeshanalipanhwar closed 3 years ago

zeeshanalipanhwar commented 3 years ago
!python demo/demo.py \
    --config-file configs/CondInst/MS_R_50_1x.yaml \
    --input 00070.jpg \
    --opts MODEL.WEIGHTS training_dir/CondInst_MS_R_50_1x/model_final.pth

The above script leads to the following:

[04/02 18:40:49 detectron2]: Arguments: Namespace(confidence_threshold=0.3, config_file='configs/CondInst/MS_R_50_1x.yaml', input=['/00070.jpg'], opts=['MODEL.WEIGHTS', 'training_dir/CondInst_MS_R_50_1x/model_final.pth'], output=None, video_input=None, webcam=False)
WARNING [04/02 18:40:49 d2.config.compat]: Config 'configs/CondInst/MS_R_50_1x.yaml' has no VERSION. Assuming it to be compatible with latest v2.
[04/02 18:40:54 detectron2]: /00070.jpg: detected 5 instances in 0.22s
: cannot connect to X server 
/usr/lib/python3.7/multiprocessing/semaphore_tracker.py:144: UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
  len(cache))

Why is that errors caused, and what is the warning about?

Mary63 commented 3 years ago

You need to define the output folder, otherwise you will get this error. Also, the output should come before —opts otherwise Detectron2 will raise error.

for example you should write it like this:

python demo/demo.py \ --config-file configs/CondInst/MS_R_50_1x.yaml \ --input 00070.jpg \ --output OutputFolder --opts MODEL.WEIGHTS training_dir/CondInst_MS_R_50_1x/model_final.pth