1

I am trying to get the demo code for Detectron2 working locally on my laptop. Everything appears to run correctly, but no object instances are detected, even when I use the image from the Colab demo.

I am running on a non-GPU Mac. I followed the installation instructions to install Detectron. I have the following module versions on my machine:

  • detectron2@git+https://github.com/facebookresearch/detectron2.git@ea3b3f22bf1de58008599794f149149ff65d3780
  • opencv-python==4.5.3.56
  • torch==1.9.0
  • torchvision==0.10.0

I copied demo.py, predictor.py, mask_rcnn_R_101_FPN_3x.yaml, and Base-RCNN-FPN.yaml from Detectron's github. I then ran inference demo with pretrained model command. The specific command was this:

python demo.py --input 000000439715.jpeg --output output --config-file mask_rcnn_R_101_FPN_3x.yaml --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl MODEL.DEVICE cpu

000000439715.jpeg is the sample image of the man on horseback from the Colab notebook demo. The last line of the output is

000000439715.jpeg: detected 0 instances in 6.77s

The image in the output directory has no annotation on it.

The logging output looks okay to me. The only thing that may be an indication of a problem is a warning at the top

[08/28 12:35:18 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='mask_rcnn_R_101_FPN_3x.yaml', input=['000000439715.jpeg'], opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl', 'MODEL.DEVICE', 'cpu'], output='output', video_input=None, webcam=False)
[08/28 12:35:18 fvcore.common.checkpoint]: [Checkpointer] Loading from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl ...
[08/28 12:35:18 fvcore.common.checkpoint]: Reading a file from 'Detectron2 Model Zoo'
WARNING [08/28 12:35:19 fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint:

I'm not sure what to do about it though.

I tried not specifying the model weights. I also tried setting the confidence threshold to zero. I got the same results.

Am I doing something wrong? What are the next debugging steps?

W.P. McNeill
  • 16,336
  • 12
  • 75
  • 111

1 Answers1

0

I met the same question with you, just like:

 WARNING [xxxxxxxxx fvcore.common.checkpoint]: Some model parameters or buffers are not found in the checkpoint:

and this warning made my result very bad. Finally I found that I use a wrong weight file. Hope this can help you.