Detectron: keypoints detection fails

Created on 7 Feb 2018  ·  4Comments  ·  Source: facebookresearch/Detectron

I'm running infer_simple.py with MaskRCNN and would like to get keypoints detection results.
Here are config changes I made:

__C.MODEL.KEYPOINTS_ON = True
__C.KRCNN.ROI_KEYPOINTS_HEAD = b'keypoint_rcnn_heads.add_roi_pose_head_v1convX'

Here is cmd (running in docker container):
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 jpeg --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 demo2

Actual results

here is output:

E0207 09:09:15.140436  1193 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.
E0207 09:09:15.140471  1193 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.
E0207 09:09:15.140481  1193 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:  57: Loading weights from: /tmp/detectron-download-cache/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
INFO net.py:  86: conv_fcn1_w not found
INFO net.py:  86: conv_fcn1_b not found
INFO net.py:  86: conv_fcn2_w not found
INFO net.py:  86: conv_fcn2_b not found
INFO net.py:  86: conv_fcn3_w not found
INFO net.py:  86: conv_fcn3_b not found
INFO net.py:  86: conv_fcn4_w not found
INFO net.py:  86: conv_fcn4_b not found
INFO net.py:  86: conv_fcn5_w not found
INFO net.py:  86: conv_fcn5_b not found
INFO net.py:  86: conv_fcn6_w not found
INFO net.py:  86: conv_fcn6_b not found
INFO net.py:  86: conv_fcn7_w not found
INFO net.py:  86: conv_fcn7_b not found
INFO net.py:  86: conv_fcn8_w not found
INFO net.py:  86: conv_fcn8_b not found
INFO net.py:  86: kps_score_w not found
INFO net.py:  86: kps_score_b not found
I0207 09:09:18.430824  1193 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000197332 secs
I0207 09:09:18.431121  1193 net_dag.cc:61] Number of parallel execution chains 63 Number of operators = 402
I0207 09:09:18.464114  1193 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000170871 secs
I0207 09:09:18.464408  1193 net_dag.cc:61] Number of parallel execution chains 30 Number of operators = 358
I0207 09:09:18.467808  1193 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 1.7301e-05 secs
I0207 09:09:18.467864  1193 net_dag.cc:61] Number of parallel execution chains 5 Number of operators = 18
I0207 09:09:18.471062  1193 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 1.599e-05 secs
I0207 09:09:18.471115  1193 net_dag.cc:61] Number of parallel execution chains 5 Number of operators = 23
INFO infer_simple.py: 111: Processing demo2/images2.jpeg -> /tmp/detectron-visualizations/images2.jpeg.pdf
terminate called after throwing an instance of 'caffe2::EnforceNotMet'
  what():  [enforce fail at blob.h:94] IsType<T>(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensor<caffe2::CUDAContext> .
Offending Blob name: gpu_0/conv_fcn1_w.
Error from operator: 
input: "gpu_0/_[pose]_roi_feat" input: "gpu_0/conv_fcn1_w" input: "gpu_0/conv_fcn1_b" output: "gpu_0/conv_fcn1" name: "" type: "Conv" arg { name: "kernel" i: 3 } arg { name: "exhaustive_search" i: 0 } arg { name: "pad" i: 1 } arg { name: "order" s: "NCHW" } arg { name: "stride" i: 1 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN"
*** Aborted at 1517994559 (unix time) try "date -d @1517994559" if you are using GNU date ***
PC: @     0x7f1f2613d428 gsignal
*** SIGABRT (@0x4a9) received by PID 1193 (TID 0x7f1e677fe700) from PID 1193; stack trace: ***
    @     0x7f1f2613d4b0 (unknown)
    @     0x7f1f2613d428 gsignal
    @     0x7f1f2613f02a abort
    @     0x7f1f200b484d __gnu_cxx::__verbose_terminate_handler()
    @     0x7f1f200b26b6 (unknown)
    @     0x7f1f200b2701 std::terminate()
    @     0x7f1f200ddd38 (unknown)
    @     0x7f1f264d96ba start_thread
    @     0x7f1f2620f41d clone
    @                0x0 (unknown)
Aborted (core dumped)

System information

  • Operating system: Ubuntu 16, nvidia docker

Most helpful comment

Thanks a lot for super quick response!
Might me worth adding this sample to the gettingstarted.md ;)

All 4 comments

Hi @olgaliak, to get keypoint results you can use one of the keypoint models from the Model Zoo.

For example, you can run e2e Keypoint R-CNN with the default ResNet-101 config using:

python2 tools/infer_simple.py \
   --cfg configs/12_2017_baselines/e2e_keypoint_rcnn_R-101-FPN_s1x.yaml \
   --output-dir /tmp/detectron-visualizations \
   --image-ext jpg \
   --wts https://s3-us-west-2.amazonaws.com/detectron/37698009/12_2017_baselines/e2e_keypoint_rcnn_R-101-FPN_s1x.yaml.08_45_57.YkrJgP6O/output/train/keypoints_coco_2014_train:keypoints_coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
  demo

Please note also that you should not change values in the config.py module. Instead, you should write a config file in yaml and load it to override the default options.

Thanks a lot for super quick response!
Might me worth adding this sample to the gettingstarted.md ;)

Hi
I am getting a similar error After training the Inceptionv4 model from scratch, I get the following errors during test. I am running on Ubuntu 16.04. Any ideas what I need to do/check?
thanks
command:
python2 tools/test_net.py --cfg configs/getting_started/ml349_2gpu_e2e_faster_rcnn
Inception_ResNetv2.yaml --multi-gpu-testing TEST.WEIGHTS /tmp/detectron-output/train/coco_2014_train/generalized
rcnn/model_final.pkl NUM_GPUS 2
Errors

==================
INFO net.py: 88: conv1-7x7_s2_w not found
INFO net.py: 88: conv1-7x7_s2_b not found
INFO net.py: 88: conv2-3x3_reduce_w not found
INFO net.py: 88: conv2-3x3_reduce_b not found
INFO net.py: 88: conv2-3x3_w not found
INFO net.py: 88: conv2-3x3_b not found
INFO net.py: 88: inception_3a-1x1_w not found
INFO net.py: 88: inception_3a-1x1_b not found
INFO net.py: 88: inception_3a-3x3_reduce_w not found
INFO net.py: 88: inception_3a-3x3_reduce_b not found
INFO net.py: 88: inception_3a-3x3_w not found
INFO net.py: 88: inception_3a-3x3_b not found
INFO net.py: 88: inception_3a-5x5_reduce_w not found
INFO net.py: 88: inception_3a-5x5_reduce_b not found
INFO net.py: 88: inception_3a-5x5_w not found
INFO net.py: 88: inception_3a-5x5_b not found
INFO net.py: 88: inception_3a-pool_proj_w not found
INFO net.py: 88: inception_3a-pool_proj_b not found
INFO net.py: 88: inception_3b-1x1_w not found
INFO net.py: 88: inception_3b-1x1_b not found
INFO net.py: 88: inception_3b-3x3_reduce_w not found
INFO net.py: 88: inception_3b-3x3_reduce_b not found
INFO net.py: 88: inception_3b-3x3_w not found
INFO net.py: 88: inception_3b-3x3_b not found
INFO net.py: 88: inception_3b-5x5_reduce_w not found
INFO net.py: 88: inception_3b-5x5_reduce_b not found
INFO net.py: 88: inception_3b-5x5_w not found
INFO net.py: 88: inception_3b-5x5_b not found
INFO net.py: 88: inception_3b-pool_proj_w not found
INFO net.py: 88: inception_3b-pool_proj_b not found
INFO net.py: 88: inception_4a-1x1_w not found
INFO net.py: 88: inception_4a-1x1_b not found
INFO net.py: 88: inception_4a-3x3_reduce_w not found
INFO net.py: 88: inception_4a-3x3_reduce_b not found
INFO net.py: 88: inception_4a-3x3_w not found
INFO net.py: 88: inception_4a-3x3_b not found
INFO net.py: 88: inception_4a-5x5_reduce_w not found
INFO net.py: 88: inception_4a-5x5_reduce_b not found
INFO net.py: 88: inception_4a-5x5_w not found
INFO net.py: 88: inception_4a-5x5_b not found
INFO net.py: 88: inception_4a-pool_proj_w not found
INFO net.py: 88: inception_4a-pool_proj_b not found
INFO net.py: 88: conv_rpn_w not found
INFO net.py: 88: conv_rpn_b not found
INFO net.py: 88: rpn_cls_logits_w not found
INFO net.py: 88: rpn_cls_logits_b not found
INFO net.py: 88: rpn_bbox_pred_w not found
INFO net.py: 88: rpn_bbox_pred_b not found
INFO net.py: 88: head_conv1_w not found
INFO net.py: 88: head_conv1_gn_s not found
INFO net.py: 88: head_conv1_gn_b not found
INFO net.py: 88: head_conv2_w not found
INFO net.py: 88: head_conv2_gn_s not found
INFO net.py: 88: head_conv2_gn_b not found
INFO net.py: 88: head_conv3_w not found
INFO net.py: 88: head_conv3_gn_s not found
INFO net.py: 88: head_conv3_gn_b not found
INFO net.py: 88: head_conv4_w not found
INFO net.py: 88: head_conv4_gn_s not found
INFO net.py: 88: head_conv4_gn_b not found
INFO net.py: 88: _mask_fcn1_w not found
INFO net.py: 88: _mask_fcn1_gn_s not found
INFO net.py: 88: _mask_fcn1_gn_b not found
INFO net.py: 88: _mask_fcn2_w not found
INFO net.py: 88: _mask_fcn2_gn_s not found
INFO net.py: 88: _mask_fcn2_gn_b not found
INFO net.py: 88: _mask_fcn3_w not found
INFO net.py: 88: _mask_fcn3_gn_s not found
INFO net.py: 88: _mask_fcn3_gn_b not found
INFO net.py: 88: _mask_fcn4_w not found
INFO net.py: 88: _mask_fcn4_gn_s not found
INFO net.py: 88: _mask_fcn4_gn_b not found
INFO net.py: 88: conv5_mask_w not found
INFO net.py: 88: conv5_mask_b not found
INFO net.py: 88: mask_fcn_logits_w not found
INFO net.py: 88: mask_fcn_logits_b not found
I0529 11:23:29.991972 25591 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 5.1028e-05 secs
I0529 11:23:29.992153 25591 net_dag.cc:46] Number of parallel execution chains 25 Number of operators = 78
I0529 11:23:29.995748 25591 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 3.4177e-05 secs
I0529 11:23:29.995859 25591 net_dag.cc:46] Number of parallel execution chains 18 Number of operators = 53
I0529 11:23:29.997187 25591 net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 1.3739e-05 secs
I0529 11:23:29.997264 25591 net_dag.cc:46] Number of parallel execution chains 1 Number of operators = 17
E0529 11:23:54.638962 26563 net_dag.cc:195] Exception from operator chain starting at '' (type 'Conv'): caffe2::EnforceNotMet: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uninitialized) while caller expects caffe2::Tensorcaffe2::CUDAContext .
Offending Blob name: gpu_0/conv1-7x7_s2_w.
Error from operator:
input: "gpu_0/data" input: "gpu_0/conv1-7x7_s2_w" input: "gpu_0/conv1-7x7_s2_b" output: "gpu_0/conv1-7x7_s2" name: "" type: "Conv" arg { name: "kernel" i: 7 } arg { name: "exhaustive_search" i: 0 } arg { name: "pad" i: 3 } arg { name: "order" s: "NCHW" } arg { name: "stride" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN"
WARNING workspace.py: 185: Original python traceback for operator 0 in network generalized_rcnn in exception above (most recent call last):
WARNING workspace.py: 190: File "/home/srikilaru/detectron/tools/test_net.py", line 116, in
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 128, in run_inference
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 125, in result_getter
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 235, in test_net
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 328, in initialize_model_from_cfg
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/model_builder.py", line 124, in create
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/model_builder.py", line 89, in generalized_rcnn
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/model_builder.py", line 230, in build_generic_detection_model
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/optimizer.py", line 54, in build_data_parallel_model
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/model_builder.py", line 170, in _single_gpu_build_func
WARNING workspace.py: 190: File "/home/srikilaru/detectron/detectron/modeling/Inception_ResNetv2.py", line 27, in add_inception_resnetv2_xxs_conv5_body
WARNING workspace.py: 190: File "/home/srikilaru/pytorch/build/caffe2/python/cnn.py", line 97, in Conv
WARNING workspace.py: 190: File "/home/srikilaru/pytorch/build/caffe2/python/brew.py", line 107, in scope_wrapper
WARNING workspace.py: 190: File "/home/srikilaru/pytorch/build/caffe2/python/helpers/conv.py", line 186, in conv
WARNING workspace.py: 190: File "/home/srikilaru/pytorch/build/caffe2/python/helpers/conv.py", line 139, in _Conv
INFO net.py: 88: inception_3b-pool_proj_b not found
Base
Traceback (most recent call last):
File "/home/srikilaru/detectron/tools/test_net.py", line 116, in
check_expected_results=True,
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 128, in run_inference
all_results = result_getter()
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 125, in result_getter
gpu_id=gpu_id
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 258, in test_net
model, im, box_proposals, timers
File "/home/srikilaru/detectron/detectron/core/test.py", line 66, in im_detect_all
model, im, cfg.TEST.SCALE, cfg.TEST.MAX_SIZE, boxes=box_proposals
File "/home/srikilaru/detectron/detectron/core/test.py", line 158, in im_detect_bbox
workspace.RunNet(model.net.Proto().name)
File "/home/srikilaru/pytorch/build/caffe2/python/workspace.py", line 217, in RunNet
StringifyNetName(name), num_iter, allow_fail,
File "/home/srikilaru/pytorch/build/caffe2/python/workspace.py", line 178, in CallWithExceptionIntercept
return func(args, *kwargs)
RuntimeError: [enforce fail at blob.h:84] IsType(). wrong type for the Blob instance. Blob contains nullptr (uni
nitialized) while caller expects caffe2::Tensorcaffe2::CUDAContext .
Offending Blob name: gpu_0/conv1-7x7_s2_w.
Error from operator:
input: "gpu_0/data" input: "gpu_0/conv1-7x7_s2_w" input: "gpu_0/conv1-7x7_s2_b" output: "gpu_0/conv1-7x7_s2" name:
"" type: "Conv" arg { name: "kernel" i: 7 } arg { name: "exhaustive_search" i: 0 } arg { name: "pad" i: 3 } arg { n
ame: "order" s: "NCHW" } arg { name: "stride" i: 2 } device_option { device_type: 1 cuda_gpu_id: 0 } engine: "CUDNN
"
Traceback (most recent call last):
File "tools/test_net.py", line 116, in
check_expected_results=True,
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 128, in run_inference
all_results = result_getter()
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 108, in result_getter
multi_gpu=multi_gpu_testing
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 155, in test_net_on_dataset
weights_file, dataset_name, proposal_file, num_images, output_dir
File "/home/srikilaru/detectron/detectron/core/test_engine.py", line 188, in multi_gpu_test_net_on_dataset
'detection', num_images, binary, output_dir, opts
File "/home/srikilaru/detectron/detectron/utils/subprocess.py", line 95, in process_in_parallel
log_subprocess_output(i, p, output_dir, tag, start, end)
File "/home/srikilaru/detectron/detectron/utils/subprocess.py", line 133, in log_subprocess_output
assert ret == 0, 'Range subprocess failed (exit code: {})'.format(ret)
AssertionError: Range subprocess failed (exit code: 1)

The same error with @srikanth-kilaru
Anyone help?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbgirshick picture rbgirshick  ·  3Comments

realwecan picture realwecan  ·  3Comments

Hwang-dae-won picture Hwang-dae-won  ·  3Comments

coldgemini picture coldgemini  ·  3Comments

gaopeng-eugene picture gaopeng-eugene  ·  4Comments