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.

Mask_R-CNN_demo assert error

See original GitHub issue

🐛 Bug

Error when run the webcam or notebook demo

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-16-ba06eae97bcc> in <module>()
      1 # compute predictions
----> 2 predictions = coco_demo.run_on_opencv_image(image)
      3 imshow(predictions)

/Users/an.tran/Desktop/map-workspace/code/maskrcnn-benchmark/demo/predictor.pyc in run_on_opencv_image(self, image)
    167                 the BoxList via `prediction.fields()`
    168         """
--> 169         predictions = self.compute_prediction(image)
    170         top_predictions = self.select_top_predictions(predictions)
    171 

/Users/an.tran/Desktop/map-workspace/code/maskrcnn-benchmark/demo/predictor.pyc in compute_prediction(self, original_image)
    212             # in the image, as defined by the bounding boxes
    213             masks = prediction.get_field("mask")
--> 214             masks = self.masker(masks, prediction)
    215             prediction.add_field("mask", masks)
    216         return prediction

/Users/an.tran/Desktop/map-workspace/code/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/inference.pyc in __call__(self, masks, boxes)
    183 
    184         # Make some sanity check
--> 185         assert len(boxes) == len(masks), "Masks and boxes should have the same length."
    186 
    187         # TODO:  Is this JIT compatible?

AssertionError: Masks and boxes should have the same length.

To Reproduce

Steps to reproduce the behavior:

  1. On Mac
  2. After installation, run the Python notebook Mask_R-CNN_demo.ipynb

Expected behavior

Environment

Please copy and paste the output from the environment collection script from PyTorch (or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

Collecting environment information… PyTorch version: 1.0.0.dev20181119 Is debug build: No CUDA used to build PyTorch: None

OS: Mac OSX 10.13.6 GCC version: Could not collect CMake version: Could not collect

Python version: 2.7 Is CUDA available: No CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA

Versions of relevant libraries: [pip] 18.0 [conda] Could not collect

Additional context

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
antran89commented, Nov 21, 2018

@fmassa it solved!

1reaction
fmassacommented, Nov 20, 2018

I’ve fixed this issue in #187 Let me know if you still face the same issue, and thanks for reporting it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoscheduler on mask rcnn raises "no task" error - Questions
I am trying to use autoscheduler to tune the pytorch official mask rcnn model maskrcnn_resnet50_fpn_coco on cpu torch version: 1.8.1 + cu102 ...
Read more >
Object Detection Using Mask R-CNN with TensorFlow
This tutorial shows how to train Mask R-CNN on a custom dataset using TensorFlow ... File "D:\Object Detection\Pure Keras\mrcnn\model.py", in detect assert ......
Read more >
Mask RCNN demo code error in jupyter notebook
I am trying to get the MASK RCNN demo code to work to see what else I need to download. I can't get...
Read more >
TensorFlow* Object Detection Mask R-CNNs Segmentation ...
This topic demonstrates how to run the Segmentation demo application, which does inference using image segmentation networks created with Object Detection API.
Read more >
Mask R-CNN Demo - Colaboratory - Google Colab
Mask R-CNN Demo ... assert boxes.shape[0] == masks.shape[-1] == ids.shape[0] ... print ('Error: Creating directory of data') frames = [] frame_count = 0...
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