Detectron: How to use not end-to-end model in Detectron?

Created on 31 Mar 2018  路  1Comment  路  Source: facebookresearch/Detectron

zhoulinmao@vismod-server-02:/home/code/zhoulinmao/FAIR/detectron$ CUDA_VISIBLE_DEVICES=3 python2 tools/infer_simple.py \

--cfg configs/12_2017_baselines/rpn_person_only_X-101-32x8d-FPN_1x.yaml \
--output-dir demo/output-test \
--image-ext jpg \
--wts models/rpn_person_only_X-101-32x8d-FPN_1x/model_final.pkl \
demo/data/frame-test/

I use the not end-to-end model in detectron in this way,i meet this problem?

Found Detectron ops lib: /home/zhoulinmao/caffe2/build/lib/libcaffe2_detectron_ops_gpu.so
E0331 16:39:00.946282 31251 init_intrinsics_check.cc:59] 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.
E0331 16:39:00.946311 31251 init_intrinsics_check.cc:59] 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.
E0331 16:39:00.946317 31251 init_intrinsics_check.cc:59] 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: 57: Loading weights from: models/rpn_person_only_X-101-32x8d-FPN_1x/model_final.pkl
I0331 16:39:07.971232 31251 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000165332 secs
I0331 16:39:07.971550 31251 net_dag.cc:61] Number of parallel execution chains 52 Number of operators = 388
I0331 16:39:07.997779 31251 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000178957 secs
I0331 16:39:07.998018 31251 net_dag.cc:61] Number of parallel execution chains 30 Number of operators = 358
INFO infer_simple.py: 112: Processing demo/data/frame-test/frame778.jpg -> demo/output-test/frame778.jpg.pdf
Traceback (most recent call last):
File "tools/infer_simple.py", line 148, in
main(args)
File "tools/infer_simple.py", line 118, in main
model, im, None, timers=timers
File "/home/code/zhoulinmao/FAIR/detectron/lib/core/test.py", line 66, in im_detect_all
model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
File "/home/code/zhoulinmao/FAIR/detectron/lib/core/test.py", line 145, in im_detect_bbox
hashes = np.round(inputs['rois'] * cfg.DEDUP_BOXES).dot(v)
KeyError: u'rois'

Most helpful comment

Hi @Markovcom, the infer_simple.py tool doesn't support running the RPN only or 2-stage models. In order to run the pretrained 2-stage models you can use the infer.py tool instead.

For example, you can run Fast R-CNN with the ResNet-50-FPN backbone using:

python2 tools/infer.py
    --im demo/15673749081_767a7fa63a_k.jpg \
    --rpn-pkl https://s3-us-west-2.amazonaws.com/detectron/35998814/12_2017_baselines/rpn_R-50-FPN_1x.yaml.08_06_03.Axg0r179/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    --rpn-cfg configs/12_2017_baselines/rpn_R-50-FPN_1x.yaml \
    https://s3-us-west-2.amazonaws.com/detectron/36225249/12_2017_baselines/fast_rcnn_R-50-FPN_2x.yaml.08_40_18.zoChak1f/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    configs/12_2017_baselines/fast_rcnn_R-50-FPN_2x.yaml

>All comments

Hi @Markovcom, the infer_simple.py tool doesn't support running the RPN only or 2-stage models. In order to run the pretrained 2-stage models you can use the infer.py tool instead.

For example, you can run Fast R-CNN with the ResNet-50-FPN backbone using:

python2 tools/infer.py
    --im demo/15673749081_767a7fa63a_k.jpg \
    --rpn-pkl https://s3-us-west-2.amazonaws.com/detectron/35998814/12_2017_baselines/rpn_R-50-FPN_1x.yaml.08_06_03.Axg0r179/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    --rpn-cfg configs/12_2017_baselines/rpn_R-50-FPN_1x.yaml \
    https://s3-us-west-2.amazonaws.com/detectron/36225249/12_2017_baselines/fast_rcnn_R-50-FPN_2x.yaml.08_40_18.zoChak1f/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    configs/12_2017_baselines/fast_rcnn_R-50-FPN_2x.yaml
Was this page helpful?
0 / 5 - 0 ratings

Related issues

pacelu picture pacelu  路  3Comments

Adhders picture Adhders  路  3Comments

twmht picture twmht  路  3Comments

olgaliak picture olgaliak  路  4Comments

elfpattern picture elfpattern  路  3Comments