facebookresearch / Detectron

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

infer.py and infer_simple.py do not support RetinaNet (was: Can't load RetinaNet for inference) #26

Closed ChengshuLi closed 6 years ago

ChengshuLi commented 6 years ago

Hi, first of all, thanks for releasing all of these wonderful models.

I succeeded in running inference code using Mask RCNN following the tutorial.

python2 tools/infer_simple.py \
    --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml \
    --output-dir /tmp/detectron-visualizations \
    --image-ext jpg \
    --wts https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    demo

But when I tried to run inference code using RetinaNet.

python2 tools/infer_simple.py \
  --cfg configs/12_2017_baselines/retinanet_R-50-FPN_1x.yaml \
  --output-dir /tmp/detectron-visualizations \
  --image-ext jpg \
  --wts https://s3-us-west-2.amazonaws.com/detectron/36768636/12_2017_baselines/retinanet_R-50-FPN_1x.yaml.08_29_48.t4zc9clc/output/train/coco_2014_train:coco_2014_valminusminival/retinanet/model_final.pkl \
  demo

I received the following error:

Traceback (most recent call last):
  File "tools/infer_simple.py", line 147, in <module>
    main(args)
  File "tools/infer_simple.py", line 99, in main
    model = infer_engine.initialize_model_from_cfg()
  File "/home/ecli/detectron/lib/core/test_engine.py", line 226, in initialize_model_from_cfg
    workspace.CreateNet(model.conv_body_net)
  File "/usr/local/caffe2/python/model_helper.py", line 468, in __getattr__
    ','.join(workspace.C.nearby_opnames(op_type)) + ']'
AttributeError: Method conv_body_net is not a registered operator. Did you mean: []

Any help would be greatly appreciated. Thanks a lot!

For your reference, I will attach the entire output on my terminal:

E0124 15:09:23.594583 23889 init_intrinsics_check.cc:54] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0124 15:09:23.594600 23889 init_intrinsics_check.cc:54] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0124 15:09:23.594604 23889 init_intrinsics_check.cc:54] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
WARNING cnn.py:  40: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information.
INFO net.py:  54: Loading from: /tmp/detectron-download-cache/36768636/12_2017_baselines/retinanet_R-50-FPN_1x.yaml.08_29_48.t4zc9clc/output/train/coco_2014_train:coco_2014_valminusminival/retinanet/model_final.pkl
INFO net.py:  91: conv1_w loaded from weights file into gpu_0/conv1_w: (64, 3, 7, 7)
INFO net.py:  91: res_conv1_bn_s loaded from weights file into gpu_0/res_conv1_bn_s: (64,)
INFO net.py:  91: res_conv1_bn_b loaded from weights file into gpu_0/res_conv1_bn_b: (64,)
INFO net.py:  91: res2_0_branch2a_w loaded from weights file into gpu_0/res2_0_branch2a_w: (64, 64, 1, 1)
INFO net.py:  91: res2_0_branch2a_bn_s loaded from weights file into gpu_0/res2_0_branch2a_bn_s: (64,)
INFO net.py:  91: res2_0_branch2a_bn_b loaded from weights file into gpu_0/res2_0_branch2a_bn_b: (64,)
INFO net.py:  91: res2_0_branch2b_w loaded from weights file into gpu_0/res2_0_branch2b_w: (64, 64, 3, 3)
INFO net.py:  91: res2_0_branch2b_bn_s loaded from weights file into gpu_0/res2_0_branch2b_bn_s: (64,)
INFO net.py:  91: res2_0_branch2b_bn_b loaded from weights file into gpu_0/res2_0_branch2b_bn_b: (64,)
INFO net.py:  91: res2_0_branch2c_w loaded from weights file into gpu_0/res2_0_branch2c_w: (256, 64, 1, 1)
INFO net.py:  91: res2_0_branch2c_bn_s loaded from weights file into gpu_0/res2_0_branch2c_bn_s: (256,)
INFO net.py:  91: res2_0_branch2c_bn_b loaded from weights file into gpu_0/res2_0_branch2c_bn_b: (256,)
INFO net.py:  91: res2_0_branch1_w loaded from weights file into gpu_0/res2_0_branch1_w: (256, 64, 1, 1)
INFO net.py:  91: res2_0_branch1_bn_s loaded from weights file into gpu_0/res2_0_branch1_bn_s: (256,)
INFO net.py:  91: res2_0_branch1_bn_b loaded from weights file into gpu_0/res2_0_branch1_bn_b: (256,)
INFO net.py:  91: res2_1_branch2a_w loaded from weights file into gpu_0/res2_1_branch2a_w: (64, 256, 1, 1)
INFO net.py:  91: res2_1_branch2a_bn_s loaded from weights file into gpu_0/res2_1_branch2a_bn_s: (64,)
INFO net.py:  91: res2_1_branch2a_bn_b loaded from weights file into gpu_0/res2_1_branch2a_bn_b: (64,)
INFO net.py:  91: res2_1_branch2b_w loaded from weights file into gpu_0/res2_1_branch2b_w: (64, 64, 3, 3)
INFO net.py:  91: res2_1_branch2b_bn_s loaded from weights file into gpu_0/res2_1_branch2b_bn_s: (64,)
INFO net.py:  91: res2_1_branch2b_bn_b loaded from weights file into gpu_0/res2_1_branch2b_bn_b: (64,)
INFO net.py:  91: res2_1_branch2c_w loaded from weights file into gpu_0/res2_1_branch2c_w: (256, 64, 1, 1)
INFO net.py:  91: res2_1_branch2c_bn_s loaded from weights file into gpu_0/res2_1_branch2c_bn_s: (256,)
INFO net.py:  91: res2_1_branch2c_bn_b loaded from weights file into gpu_0/res2_1_branch2c_bn_b: (256,)
INFO net.py:  91: res2_2_branch2a_w loaded from weights file into gpu_0/res2_2_branch2a_w: (64, 256, 1, 1)
INFO net.py:  91: res2_2_branch2a_bn_s loaded from weights file into gpu_0/res2_2_branch2a_bn_s: (64,)
INFO net.py:  91: res2_2_branch2a_bn_b loaded from weights file into gpu_0/res2_2_branch2a_bn_b: (64,)
INFO net.py:  91: res2_2_branch2b_w loaded from weights file into gpu_0/res2_2_branch2b_w: (64, 64, 3, 3)
INFO net.py:  91: res2_2_branch2b_bn_s loaded from weights file into gpu_0/res2_2_branch2b_bn_s: (64,)
INFO net.py:  91: res2_2_branch2b_bn_b loaded from weights file into gpu_0/res2_2_branch2b_bn_b: (64,)
INFO net.py:  91: res2_2_branch2c_w loaded from weights file into gpu_0/res2_2_branch2c_w: (256, 64, 1, 1)
INFO net.py:  91: res2_2_branch2c_bn_s loaded from weights file into gpu_0/res2_2_branch2c_bn_s: (256,)
INFO net.py:  91: res2_2_branch2c_bn_b loaded from weights file into gpu_0/res2_2_branch2c_bn_b: (256,)
INFO net.py:  91: res3_0_branch2a_w [+ momentum] loaded from weights file into gpu_0/res3_0_branch2a_w: (128, 256, 1, 1)
INFO net.py:  91: res3_0_branch2a_bn_s loaded from weights file into gpu_0/res3_0_branch2a_bn_s: (128,)
INFO net.py:  91: res3_0_branch2a_bn_b loaded from weights file into gpu_0/res3_0_branch2a_bn_b: (128,)
INFO net.py:  91: res3_0_branch2b_w [+ momentum] loaded from weights file into gpu_0/res3_0_branch2b_w: (128, 128, 3, 3)
INFO net.py:  91: res3_0_branch2b_bn_s loaded from weights file into gpu_0/res3_0_branch2b_bn_s: (128,)
INFO net.py:  91: res3_0_branch2b_bn_b loaded from weights file into gpu_0/res3_0_branch2b_bn_b: (128,)
INFO net.py:  91: res3_0_branch2c_w [+ momentum] loaded from weights file into gpu_0/res3_0_branch2c_w: (512, 128, 1, 1)
INFO net.py:  91: res3_0_branch2c_bn_s loaded from weights file into gpu_0/res3_0_branch2c_bn_s: (512,)
INFO net.py:  91: res3_0_branch2c_bn_b loaded from weights file into gpu_0/res3_0_branch2c_bn_b: (512,)
INFO net.py:  91: res3_0_branch1_w [+ momentum] loaded from weights file into gpu_0/res3_0_branch1_w: (512, 256, 1, 1)
INFO net.py:  91: res3_0_branch1_bn_s loaded from weights file into gpu_0/res3_0_branch1_bn_s: (512,)
INFO net.py:  91: res3_0_branch1_bn_b loaded from weights file into gpu_0/res3_0_branch1_bn_b: (512,)
INFO net.py:  91: res3_1_branch2a_w [+ momentum] loaded from weights file into gpu_0/res3_1_branch2a_w: (128, 512, 1, 1)
INFO net.py:  91: res3_1_branch2a_bn_s loaded from weights file into gpu_0/res3_1_branch2a_bn_s: (128,)
INFO net.py:  91: res3_1_branch2a_bn_b loaded from weights file into gpu_0/res3_1_branch2a_bn_b: (128,)
INFO net.py:  91: res3_1_branch2b_w [+ momentum] loaded from weights file into gpu_0/res3_1_branch2b_w: (128, 128, 3, 3)
INFO net.py:  91: res3_1_branch2b_bn_s loaded from weights file into gpu_0/res3_1_branch2b_bn_s: (128,)
INFO net.py:  91: res3_1_branch2b_bn_b loaded from weights file into gpu_0/res3_1_branch2b_bn_b: (128,)
INFO net.py:  91: res3_1_branch2c_w [+ momentum] loaded from weights file into gpu_0/res3_1_branch2c_w: (512, 128, 1, 1)
INFO net.py:  91: res3_1_branch2c_bn_s loaded from weights file into gpu_0/res3_1_branch2c_bn_s: (512,)
INFO net.py:  91: res3_1_branch2c_bn_b loaded from weights file into gpu_0/res3_1_branch2c_bn_b: (512,)
INFO net.py:  91: res3_2_branch2a_w [+ momentum] loaded from weights file into gpu_0/res3_2_branch2a_w: (128, 512, 1, 1)
INFO net.py:  91: res3_2_branch2a_bn_s loaded from weights file into gpu_0/res3_2_branch2a_bn_s: (128,)
INFO net.py:  91: res3_2_branch2a_bn_b loaded from weights file into gpu_0/res3_2_branch2a_bn_b: (128,)
INFO net.py:  91: res3_2_branch2b_w [+ momentum] loaded from weights file into gpu_0/res3_2_branch2b_w: (128, 128, 3, 3)
INFO net.py:  91: res3_2_branch2b_bn_s loaded from weights file into gpu_0/res3_2_branch2b_bn_s: (128,)
INFO net.py:  91: res3_2_branch2b_bn_b loaded from weights file into gpu_0/res3_2_branch2b_bn_b: (128,)
INFO net.py:  91: res3_2_branch2c_w [+ momentum] loaded from weights file into gpu_0/res3_2_branch2c_w: (512, 128, 1, 1)
INFO net.py:  91: res3_2_branch2c_bn_s loaded from weights file into gpu_0/res3_2_branch2c_bn_s: (512,)
INFO net.py:  91: res3_2_branch2c_bn_b loaded from weights file into gpu_0/res3_2_branch2c_bn_b: (512,)
INFO net.py:  91: res3_3_branch2a_w [+ momentum] loaded from weights file into gpu_0/res3_3_branch2a_w: (128, 512, 1, 1)
INFO net.py:  91: res3_3_branch2a_bn_s loaded from weights file into gpu_0/res3_3_branch2a_bn_s: (128,)
INFO net.py:  91: res3_3_branch2a_bn_b loaded from weights file into gpu_0/res3_3_branch2a_bn_b: (128,)
INFO net.py:  91: res3_3_branch2b_w [+ momentum] loaded from weights file into gpu_0/res3_3_branch2b_w: (128, 128, 3, 3)
INFO net.py:  91: res3_3_branch2b_bn_s loaded from weights file into gpu_0/res3_3_branch2b_bn_s: (128,)
INFO net.py:  91: res3_3_branch2b_bn_b loaded from weights file into gpu_0/res3_3_branch2b_bn_b: (128,)
INFO net.py:  91: res3_3_branch2c_w [+ momentum] loaded from weights file into gpu_0/res3_3_branch2c_w: (512, 128, 1, 1)
INFO net.py:  91: res3_3_branch2c_bn_s loaded from weights file into gpu_0/res3_3_branch2c_bn_s: (512,)
INFO net.py:  91: res3_3_branch2c_bn_b loaded from weights file into gpu_0/res3_3_branch2c_bn_b: (512,)
INFO net.py:  91: res4_0_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_0_branch2a_w: (256, 512, 1, 1)
INFO net.py:  91: res4_0_branch2a_bn_s loaded from weights file into gpu_0/res4_0_branch2a_bn_s: (256,)
INFO net.py:  91: res4_0_branch2a_bn_b loaded from weights file into gpu_0/res4_0_branch2a_bn_b: (256,)
INFO net.py:  91: res4_0_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_0_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_0_branch2b_bn_s loaded from weights file into gpu_0/res4_0_branch2b_bn_s: (256,)
INFO net.py:  91: res4_0_branch2b_bn_b loaded from weights file into gpu_0/res4_0_branch2b_bn_b: (256,)
INFO net.py:  91: res4_0_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_0_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_0_branch2c_bn_s loaded from weights file into gpu_0/res4_0_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_0_branch2c_bn_b loaded from weights file into gpu_0/res4_0_branch2c_bn_b: (1024,)
INFO net.py:  91: res4_0_branch1_w [+ momentum] loaded from weights file into gpu_0/res4_0_branch1_w: (1024, 512, 1, 1)
INFO net.py:  91: res4_0_branch1_bn_s loaded from weights file into gpu_0/res4_0_branch1_bn_s: (1024,)
INFO net.py:  91: res4_0_branch1_bn_b loaded from weights file into gpu_0/res4_0_branch1_bn_b: (1024,)
INFO net.py:  91: res4_1_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_1_branch2a_w: (256, 1024, 1, 1)
INFO net.py:  91: res4_1_branch2a_bn_s loaded from weights file into gpu_0/res4_1_branch2a_bn_s: (256,)
INFO net.py:  91: res4_1_branch2a_bn_b loaded from weights file into gpu_0/res4_1_branch2a_bn_b: (256,)
INFO net.py:  91: res4_1_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_1_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_1_branch2b_bn_s loaded from weights file into gpu_0/res4_1_branch2b_bn_s: (256,)
INFO net.py:  91: res4_1_branch2b_bn_b loaded from weights file into gpu_0/res4_1_branch2b_bn_b: (256,)
INFO net.py:  91: res4_1_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_1_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_1_branch2c_bn_s loaded from weights file into gpu_0/res4_1_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_1_branch2c_bn_b loaded from weights file into gpu_0/res4_1_branch2c_bn_b: (1024,)
INFO net.py:  91: res4_2_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_2_branch2a_w: (256, 1024, 1, 1)
INFO net.py:  91: res4_2_branch2a_bn_s loaded from weights file into gpu_0/res4_2_branch2a_bn_s: (256,)
INFO net.py:  91: res4_2_branch2a_bn_b loaded from weights file into gpu_0/res4_2_branch2a_bn_b: (256,)
INFO net.py:  91: res4_2_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_2_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_2_branch2b_bn_s loaded from weights file into gpu_0/res4_2_branch2b_bn_s: (256,)
INFO net.py:  91: res4_2_branch2b_bn_b loaded from weights file into gpu_0/res4_2_branch2b_bn_b: (256,)
INFO net.py:  91: res4_2_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_2_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_2_branch2c_bn_s loaded from weights file into gpu_0/res4_2_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_2_branch2c_bn_b loaded from weights file into gpu_0/res4_2_branch2c_bn_b: (1024,)
INFO net.py:  91: res4_3_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_3_branch2a_w: (256, 1024, 1, 1)
INFO net.py:  91: res4_3_branch2a_bn_s loaded from weights file into gpu_0/res4_3_branch2a_bn_s: (256,)
INFO net.py:  91: res4_3_branch2a_bn_b loaded from weights file into gpu_0/res4_3_branch2a_bn_b: (256,)
INFO net.py:  91: res4_3_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_3_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_3_branch2b_bn_s loaded from weights file into gpu_0/res4_3_branch2b_bn_s: (256,)
INFO net.py:  91: res4_3_branch2b_bn_b loaded from weights file into gpu_0/res4_3_branch2b_bn_b: (256,)
INFO net.py:  91: res4_3_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_3_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_3_branch2c_bn_s loaded from weights file into gpu_0/res4_3_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_3_branch2c_bn_b loaded from weights file into gpu_0/res4_3_branch2c_bn_b: (1024,)
INFO net.py:  91: res4_4_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_4_branch2a_w: (256, 1024, 1, 1)
INFO net.py:  91: res4_4_branch2a_bn_s loaded from weights file into gpu_0/res4_4_branch2a_bn_s: (256,)
INFO net.py:  91: res4_4_branch2a_bn_b loaded from weights file into gpu_0/res4_4_branch2a_bn_b: (256,)
INFO net.py:  91: res4_4_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_4_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_4_branch2b_bn_s loaded from weights file into gpu_0/res4_4_branch2b_bn_s: (256,)
INFO net.py:  91: res4_4_branch2b_bn_b loaded from weights file into gpu_0/res4_4_branch2b_bn_b: (256,)
INFO net.py:  91: res4_4_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_4_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_4_branch2c_bn_s loaded from weights file into gpu_0/res4_4_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_4_branch2c_bn_b loaded from weights file into gpu_0/res4_4_branch2c_bn_b: (1024,)
INFO net.py:  91: res4_5_branch2a_w [+ momentum] loaded from weights file into gpu_0/res4_5_branch2a_w: (256, 1024, 1, 1)
INFO net.py:  91: res4_5_branch2a_bn_s loaded from weights file into gpu_0/res4_5_branch2a_bn_s: (256,)
INFO net.py:  91: res4_5_branch2a_bn_b loaded from weights file into gpu_0/res4_5_branch2a_bn_b: (256,)
INFO net.py:  91: res4_5_branch2b_w [+ momentum] loaded from weights file into gpu_0/res4_5_branch2b_w: (256, 256, 3, 3)
INFO net.py:  91: res4_5_branch2b_bn_s loaded from weights file into gpu_0/res4_5_branch2b_bn_s: (256,)
INFO net.py:  91: res4_5_branch2b_bn_b loaded from weights file into gpu_0/res4_5_branch2b_bn_b: (256,)
INFO net.py:  91: res4_5_branch2c_w [+ momentum] loaded from weights file into gpu_0/res4_5_branch2c_w: (1024, 256, 1, 1)
INFO net.py:  91: res4_5_branch2c_bn_s loaded from weights file into gpu_0/res4_5_branch2c_bn_s: (1024,)
INFO net.py:  91: res4_5_branch2c_bn_b loaded from weights file into gpu_0/res4_5_branch2c_bn_b: (1024,)
INFO net.py:  91: res5_0_branch2a_w [+ momentum] loaded from weights file into gpu_0/res5_0_branch2a_w: (512, 1024, 1, 1)
INFO net.py:  91: res5_0_branch2a_bn_s loaded from weights file into gpu_0/res5_0_branch2a_bn_s: (512,)
INFO net.py:  91: res5_0_branch2a_bn_b loaded from weights file into gpu_0/res5_0_branch2a_bn_b: (512,)
INFO net.py:  91: res5_0_branch2b_w [+ momentum] loaded from weights file into gpu_0/res5_0_branch2b_w: (512, 512, 3, 3)
INFO net.py:  91: res5_0_branch2b_bn_s loaded from weights file into gpu_0/res5_0_branch2b_bn_s: (512,)
INFO net.py:  91: res5_0_branch2b_bn_b loaded from weights file into gpu_0/res5_0_branch2b_bn_b: (512,)
INFO net.py:  91: res5_0_branch2c_w [+ momentum] loaded from weights file into gpu_0/res5_0_branch2c_w: (2048, 512, 1, 1)
INFO net.py:  91: res5_0_branch2c_bn_s loaded from weights file into gpu_0/res5_0_branch2c_bn_s: (2048,)
INFO net.py:  91: res5_0_branch2c_bn_b loaded from weights file into gpu_0/res5_0_branch2c_bn_b: (2048,)
INFO net.py:  91: res5_0_branch1_w [+ momentum] loaded from weights file into gpu_0/res5_0_branch1_w: (2048, 1024, 1, 1)
INFO net.py:  91: res5_0_branch1_bn_s loaded from weights file into gpu_0/res5_0_branch1_bn_s: (2048,)
INFO net.py:  91: res5_0_branch1_bn_b loaded from weights file into gpu_0/res5_0_branch1_bn_b: (2048,)
INFO net.py:  91: res5_1_branch2a_w [+ momentum] loaded from weights file into gpu_0/res5_1_branch2a_w: (512, 2048, 1, 1)
INFO net.py:  91: res5_1_branch2a_bn_s loaded from weights file into gpu_0/res5_1_branch2a_bn_s: (512,)
INFO net.py:  91: res5_1_branch2a_bn_b loaded from weights file into gpu_0/res5_1_branch2a_bn_b: (512,)
INFO net.py:  91: res5_1_branch2b_w [+ momentum] loaded from weights file into gpu_0/res5_1_branch2b_w: (512, 512, 3, 3)
INFO net.py:  91: res5_1_branch2b_bn_s loaded from weights file into gpu_0/res5_1_branch2b_bn_s: (512,)
INFO net.py:  91: res5_1_branch2b_bn_b loaded from weights file into gpu_0/res5_1_branch2b_bn_b: (512,)
INFO net.py:  91: res5_1_branch2c_w [+ momentum] loaded from weights file into gpu_0/res5_1_branch2c_w: (2048, 512, 1, 1)
INFO net.py:  91: res5_1_branch2c_bn_s loaded from weights file into gpu_0/res5_1_branch2c_bn_s: (2048,)
INFO net.py:  91: res5_1_branch2c_bn_b loaded from weights file into gpu_0/res5_1_branch2c_bn_b: (2048,)
INFO net.py:  91: res5_2_branch2a_w [+ momentum] loaded from weights file into gpu_0/res5_2_branch2a_w: (512, 2048, 1, 1)
INFO net.py:  91: res5_2_branch2a_bn_s loaded from weights file into gpu_0/res5_2_branch2a_bn_s: (512,)
INFO net.py:  91: res5_2_branch2a_bn_b loaded from weights file into gpu_0/res5_2_branch2a_bn_b: (512,)
INFO net.py:  91: res5_2_branch2b_w [+ momentum] loaded from weights file into gpu_0/res5_2_branch2b_w: (512, 512, 3, 3)
INFO net.py:  91: res5_2_branch2b_bn_s loaded from weights file into gpu_0/res5_2_branch2b_bn_s: (512,)
INFO net.py:  91: res5_2_branch2b_bn_b loaded from weights file into gpu_0/res5_2_branch2b_bn_b: (512,)
INFO net.py:  91: res5_2_branch2c_w [+ momentum] loaded from weights file into gpu_0/res5_2_branch2c_w: (2048, 512, 1, 1)
INFO net.py:  91: res5_2_branch2c_bn_s loaded from weights file into gpu_0/res5_2_branch2c_bn_s: (2048,)
INFO net.py:  91: res5_2_branch2c_bn_b loaded from weights file into gpu_0/res5_2_branch2c_bn_b: (2048,)
INFO net.py:  91: fpn_inner_res5_2_sum_w [+ momentum] loaded from weights file into gpu_0/fpn_inner_res5_2_sum_w: (256, 2048, 1, 1)
INFO net.py:  91: fpn_inner_res5_2_sum_b [+ momentum] loaded from weights file into gpu_0/fpn_inner_res5_2_sum_b: (256,)
INFO net.py:  91: fpn_inner_res4_5_sum_lateral_w [+ momentum] loaded from weights file into gpu_0/fpn_inner_res4_5_sum_lateral_w: (256, 1024, 1, 1)
INFO net.py:  91: fpn_inner_res4_5_sum_lateral_b [+ momentum] loaded from weights file into gpu_0/fpn_inner_res4_5_sum_lateral_b: (256,)
INFO net.py:  91: fpn_inner_res3_3_sum_lateral_w [+ momentum] loaded from weights file into gpu_0/fpn_inner_res3_3_sum_lateral_w: (256, 512, 1, 1)
INFO net.py:  91: fpn_inner_res3_3_sum_lateral_b [+ momentum] loaded from weights file into gpu_0/fpn_inner_res3_3_sum_lateral_b: (256,)
INFO net.py:  91: fpn_res5_2_sum_w [+ momentum] loaded from weights file into gpu_0/fpn_res5_2_sum_w: (256, 256, 3, 3)
INFO net.py:  91: fpn_res5_2_sum_b [+ momentum] loaded from weights file into gpu_0/fpn_res5_2_sum_b: (256,)
INFO net.py:  91: fpn_res4_5_sum_w [+ momentum] loaded from weights file into gpu_0/fpn_res4_5_sum_w: (256, 256, 3, 3)
INFO net.py:  91: fpn_res4_5_sum_b [+ momentum] loaded from weights file into gpu_0/fpn_res4_5_sum_b: (256,)
INFO net.py:  91: fpn_res3_3_sum_w [+ momentum] loaded from weights file into gpu_0/fpn_res3_3_sum_w: (256, 256, 3, 3)
INFO net.py:  91: fpn_res3_3_sum_b [+ momentum] loaded from weights file into gpu_0/fpn_res3_3_sum_b: (256,)
INFO net.py:  91: fpn_6_w [+ momentum] loaded from weights file into gpu_0/fpn_6_w: (256, 2048, 3, 3)
INFO net.py:  91: fpn_6_b [+ momentum] loaded from weights file into gpu_0/fpn_6_b: (256,)
INFO net.py:  91: fpn_7_w [+ momentum] loaded from weights file into gpu_0/fpn_7_w: (256, 256, 3, 3)
INFO net.py:  91: fpn_7_b [+ momentum] loaded from weights file into gpu_0/fpn_7_b: (256,)
INFO net.py:  91: retnet_cls_conv_n0_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n0_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_cls_conv_n0_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n0_fpn3_b: (256,)
INFO net.py:  91: retnet_cls_conv_n1_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n1_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_cls_conv_n1_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n1_fpn3_b: (256,)
INFO net.py:  91: retnet_cls_conv_n2_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n2_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_cls_conv_n2_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n2_fpn3_b: (256,)
INFO net.py:  91: retnet_cls_conv_n3_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n3_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_cls_conv_n3_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_cls_conv_n3_fpn3_b: (256,)
INFO net.py:  91: retnet_cls_pred_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_cls_pred_fpn3_w: (720, 256, 3, 3)
INFO net.py:  91: retnet_cls_pred_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_cls_pred_fpn3_b: (720,)
INFO net.py:  91: retnet_bbox_conv_n0_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n0_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_bbox_conv_n0_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n0_fpn3_b: (256,)
INFO net.py:  91: retnet_bbox_conv_n1_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n1_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_bbox_conv_n1_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n1_fpn3_b: (256,)
INFO net.py:  91: retnet_bbox_conv_n2_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n2_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_bbox_conv_n2_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n2_fpn3_b: (256,)
INFO net.py:  91: retnet_bbox_conv_n3_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n3_fpn3_w: (256, 256, 3, 3)
INFO net.py:  91: retnet_bbox_conv_n3_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_bbox_conv_n3_fpn3_b: (256,)
INFO net.py:  91: retnet_bbox_pred_fpn3_w [+ momentum] loaded from weights file into gpu_0/retnet_bbox_pred_fpn3_w: (36, 256, 3, 3)
INFO net.py:  91: retnet_bbox_pred_fpn3_b [+ momentum] loaded from weights file into gpu_0/retnet_bbox_pred_fpn3_b: (36,)
INFO net.py: 125: res3_1_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res2_2_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res3_3_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_4_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res4_5_branch2b_b preserved in workspace (unused)
INFO net.py: 125: conv1_b preserved in workspace (unused)
INFO net.py: 125: fc1000_b preserved in workspace (unused)
INFO net.py: 125: fc1000_w preserved in workspace (unused)
INFO net.py: 125: res4_0_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res4_1_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_0_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res4_5_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res3_2_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res4_3_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res2_0_branch1_b preserved in workspace (unused)
INFO net.py: 125: res2_1_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_0_branch1_b preserved in workspace (unused)
INFO net.py: 125: res2_2_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res5_1_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res2_1_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res3_2_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res3_0_branch1_b preserved in workspace (unused)
INFO net.py: 125: res4_2_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res2_0_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res5_2_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res4_1_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_0_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res4_0_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_5_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_2_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res2_1_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res3_1_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res3_0_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res2_2_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res3_1_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_1_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_1_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_4_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_2_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res3_3_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res3_2_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res3_3_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res4_1_branch2b_b preserved in workspace (unused)
INFO net.py: 125: res4_2_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res2_0_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_4_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res4_3_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_0_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res5_2_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_0_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res3_0_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res5_0_branch1_b preserved in workspace (unused)
INFO net.py: 125: res3_0_branch2c_b preserved in workspace (unused)
INFO net.py: 125: res2_0_branch2a_b preserved in workspace (unused)
INFO net.py: 125: res4_3_branch2c_b preserved in workspace (unused)
I0124 15:09:25.705162 23889 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 7.5954e-05 secs
I0124 15:09:25.705276 23889 net_dag.cc:61] Number of parallel execution chains 41 Number of operators = 281
Traceback (most recent call last):
  File "tools/infer_simple.py", line 147, in <module>
    main(args)
  File "tools/infer_simple.py", line 99, in main
    model = infer_engine.initialize_model_from_cfg()
  File "/home/ecli/detectron/lib/core/test_engine.py", line 226, in initialize_model_from_cfg
    workspace.CreateNet(model.conv_body_net)
  File "/usr/local/caffe2/python/model_helper.py", line 468, in __getattr__
    ','.join(workspace.C.nearby_opnames(op_type)) + ']'
AttributeError: Method conv_body_net is not a registered operator. Did you mean: []
rbgirshick commented 6 years ago

Thanks for reporting! We are able to repro the issue. It turns out that RetinaNet uses a different inference code path that is not currently supported by infer_simple.py. We'll work on fixing that. In the meantime, it should work for inference on the COCO dataset; just not via infer_simple.py.

ChengshuLi commented 6 years ago

@rbgirshick Thanks for your prompt reply.

So you are saying python2 tools/test_net.py should still work? I will go ahead and try it. Please let me know when you have fixed this by closing this issue. Thanks.

Meanwhile, am I able to fine-tune on my own dataset and labels using RetinaNet?

Thanks again.

rbgirshick commented 6 years ago

@ChengshuLi: yes, correct, tools/test_net.py should still work (though note that it will run inference on a dataset---coco_2014_minival by default---and not an arbitrary directory of files). Before we address the root issue, you can probably pretty easily figure out how to hack the code to make inference run on any image you want.

ChengshuLi commented 6 years ago

@rbgirshick

Thanks!

I am still a little bit confused about how to set up the COCO dataset.

Here are things that I have done:

  1. I followed your tutorial and made sure /path/to/coco has the following directory structure:
coco
|_ coco_train2014
|  |_ <im-1-name>.jpg
|  |_ ...
|  |_ <im-N-name>.jpg
|_ coco_val2014
|_ ...
|_ annotations
   |_ instances_train2014.json
   |_ ...
  1. I downloaded your custom minival and valminusminival annotations and copied the minival and valminusminival json annotation files to the coco/annotations directory referenced above.
  2. I symlinked the COCO dataset
    ln -s /path/to/coco $DETECTRON/lib/datasets/data/coco
  3. I am able to run the following example code
    python2 tools/test_net.py \
    --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml \
    TEST.WEIGHTS https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    NUM_GPUS 1

    The output looks correct:

    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 1/5000 0.649s + 0.025s (eta: 0:56:09)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 11/5000 0.148s + 0.011s (eta: 0:13:12)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 21/5000 0.121s + 0.009s (eta: 0:10:46)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 31/5000 0.122s + 0.009s (eta: 0:10:49)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 41/5000 0.116s + 0.009s (eta: 0:10:19)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 51/5000 0.112s + 0.010s (eta: 0:10:02)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 61/5000 0.110s + 0.009s (eta: 0:09:49)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 71/5000 0.108s + 0.009s (eta: 0:09:35)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 81/5000 0.107s + 0.009s (eta: 0:09:28)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 91/5000 0.106s + 0.009s (eta: 0:09:23)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 101/5000 0.105s + 0.009s (eta: 0:09:18)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 111/5000 0.103s + 0.009s (eta: 0:09:10)
    INFO test_engine.py: 179: im_detect: range [1, 5000] of 5000: 121/5000 0.103s + 0.009s (eta: 0:09:08)

But I am not sure where the detection results are stored. Also, in /path/to/coco, there are only coco_train2014 and coco_val2014. Where is coco_2014_minival then?

ChengshuLi commented 6 years ago

After reading the code, I found the detection results are stored in $DETECTRON//test/coco_2014_minival/generalized_rcnn.

Thanks!

ir413 commented 6 years ago

Hi @ChengshuLi, we addressed this issue in dd6c661 and you should now be able to use infer.py and infer_simple.py with RetinaNet.

moyans commented 6 years ago

@ir413 It can't run successfully:

I0130 11:35:05.469234 21503 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000156796 secs I0130 11:35:05.469467 21503 net_dag.cc:61] Number of parallel execution chains 41 Number of operators = 281 Traceback (most recent call last): File "tools/infer_simple.py", line 147, in main(args) File "tools/infer_simple.py", line 99, in main model = infer_engine.initialize_model_from_cfg() File "/home/moyan/caffe2/detectron/lib/core/test_engine.py", line 225, in initialize_model_from_cfg workspace.CreateNet(model.conv_body_net) File "/usr/local/caffe2/python/model_helper.py", line 468, in getattr ','.join(workspace.C.nearby_opnames(op_type)) + ']' AttributeError: Method conv_body_net is not a registered operator. Did you mean: []

ir413 commented 6 years ago

Hi @moyans, please make sure that you've pulled the latest master.

learnbott commented 6 years ago

I also get the same error for retinanet for both infer.py and infer_simple.py, even after pulling the latest (10 mins ago).

learnbott commented 6 years ago

EDIT: turns out I love Detectron so much I cloned it twice. Both infer.py and infer_simple.py work great for retinanet. Thank you so much for fixing this!

moyans commented 6 years ago

yes. it work great for retinanet