matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.63k stars 11.7k forks source link

issue while running detection on images #1795

Open manojkumar621 opened 5 years ago

manojkumar621 commented 5 years ago

I am trying to run detection in validation dataset, I am getting the following error. AssertionError Traceback (most recent call last)

in 7 8 # Run object detection ----> 9 results = model.detect([image], verbose=1) 10 11 # Display results ~\maskrcnn\mask-rcnn\mask_rcnn_damage_detection\mrcnn\model.py in detect(self, images, verbose) 2500 """ 2501 assert self.mode == "inference", "Create model in inference mode." -> 2502 assert len( 2503 images) == self.config.BATCH_SIZE, "len(images) must be equal to BATCH_SIZE" 2504 AssertionError: len(images) must be equal to BATCH_SIZE can somebody help me please?? I am a newbie.
Mahi-Mai commented 5 years ago

I'm also experiencing this problem. Let's remember to post here if we find a solution!

Mahi-Mai commented 5 years ago

Alright, friend. I'm guessing you're working on more than one GPU, yes? Like me. Set InferenceConfig like below.

class InferenceConfig(CornCobConfig):
    GPU_COUNT = 1
    IMAGES_PER_GPU = 1

I think this was actually what it was originally set to, but if you're anything like me, you saw GPU_COUNT and jumped the gun.

(BATCH_SIZE is defined by GPU_COUNT*IMAGES_PER_GPU, and the BATCH_SIZE referred to in the error belongs to inference_config.)