question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inference error when use config file ms_rcnn_x101_64x4d_fpn_1x.py

See original GitHub issue

Thanks for your error report and we appreciate it a lot.

Checklist 1.I’m not find the bug has been fixed 2. en… the amount of the issues is so much

Describe the bug an error occured when i inference use ms_rcnn_x101_64x4d_fpn_1x model,the detail of the error is as follows:

Traceback (most recent call last): File “infer_oct_binary_ms.py”, line 389, in <module> dic_img_name_to_disease_list=inference_OCT(config_file,checkpoint_file,out_file,test_img_dir,score_thr,normal_img_dir) File “infer_oct_binary_ms.py”, line 27, in inference_OCT out_file=out_file+‘/{}’.format(img_name)) File “/home/lwc/GitHub/mmdetection/mmdet/apis/inference.py”, line 136, in show_result img[mask] = img[mask] * 0.5 + color_mask * 0.5 IndexError: boolean index did not match indexed array along dimension 2; dimension is 3 but corresponding boolean dimension is 2

I found that the shape of the mask is (494, 765, 2) ,and the shape of the img is (494, 765, 3) in ms ,for comparision, the inference for cascade mask rcnn model is runned again,and the shape of the mask is (494, 765)

Reproduction

  1. What command or script did you run?
A placeholder for the command.
  1. Did you make any modifications on the code or config? Did you understand what you have modified? I just add return for the result without modifying the code.
  2. What dataset did you use? None Environment I think it’s none of the environment’s business
  • OS: [e.g., Ubuntu 16.04.6]
  • GCC [e.g., 5.4.0]
  • PyTorch version [e.g., 1.1.0]
  • How you installed PyTorch [e.g., pip, conda, source]
  • GPU model [e.g., 1080Ti, V100]
  • CUDA and CUDNN version: CUDA 10.1 CUDNN:7.1
  • [optional] Other information that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

Error traceback If applicable, paste the error trackback here.

dic_img_name_to_disease_list=inference_OCT(config_file,checkpoint_file,out_file,test_img_dir,score_thr,normal_img_dir)
  File "infer_oct_binary_ms.py", line 27, in inference_OCT
    out_file=out_file+'/{}'.format(img_name))
  File "/home/lwc/GitHub/mmdetection/mmdet/apis/inference.py", line 136, in show_result
    img[mask] = img[mask] * 0.5 + color_mask * 0.5
IndexError: boolean index did not match indexed array along dimension 2; dimension is 3 but corresponding boolean dimension is 2

Bug fix None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
github-eliviatecommented, Oct 10, 2019

Thanks for reporting the bug. This is the temporary solution.

result = inference_detector(model, img)
result = (result[0], result[1][0])
0reactions
github-eliviatecommented, May 17, 2020

when you use mask score R-CNN for inference, extra code should be added after inference_detector function to get the result object, the extra code is result = (result[0], result[1][0]),just as i said before

Read more comments on GitHub >

github_iconTop Results From Across the Web

configparser — Configuration file parser — Python 3.11.1 ...
This module provides the ConfigParser class which implements a basic configuration language which provides a structure similar to what's found in Microsoft ...
Read more >
export inference graph gives error when num_of_stages
I tried generating inference graph using command: python3 export_inference_graph.py --input_type image_tensor --pipeline_config_path ...
Read more >
Configuration File - Prettier
This means you can configure Prettier via (in order of precedence): ... The options you can use in the configuration file are the...
Read more >
Inference and train with existing models and standard datasets
By inference, we mean using trained models to detect objects on images. In MMDetection, a model is defined by a configuration file and...
Read more >
Configuration - Hugging Face
The base class PretrainedConfig implements the common methods for ... Loading the configuration file and using this file to initialize a model does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found