facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.21k stars 5.45k forks source link

AssertionError: Override list has odd length #993

Closed ChauncyFr closed 4 years ago

ChauncyFr commented 4 years ago

When I installed detectron2, I wanted to test the instance segmentation model. I executed the following commands as required:

“Python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input input1.jpg --output output --opts ../pretrain/model_final_f10217.pkl

But remind me, "AssertionError: Override list has odd length: ['../pretrain/model_final_f10217.pkl']; it must be a list of pairs"

Specific as shown

jianghan0213 commented 3 years ago

Do you know how to solve this problem?

DominikFilipiak commented 2 years ago

@jianghan0213 Judging by the command, there was a missing MODEL.WEIGHTS parameter before the actual path to model weights. It should look more or less like this:

python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml --input input1.jpg --output output --opts MODEL.WEIGHTS ../pretrain/model_final_f10217.pkl

Be sure to set the proper paths to the weights, as it was the cause of problems in my case.

koojaekwan commented 2 years ago

['MODEL.WEIGHTS', 'detectron2://COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x/139173657/model_final_68b088.pkl']