Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

Type object "Config" has no attribute "image_shape"

Open kiwi447 opened this issue 2 years ago • 1 comments

I am trying to recreate the "Brain tumor masking using MRCNN" project. However, I'm running into a problem as shown in the title. I'm unable to get through this line

Create model object in inference mode.

model = modellib.MaskRCNN(mode="inference", model_dir=MODEL_DIR, config=config). Can anyone tell me what is wrong and how can I solve it? Thanks a lot!!

kiwi447 avatar Sep 24 '23 10:09 kiwi447

The mode is in 'inference' if you have defined a different class for Inference then, config=config will not work. My code for eg is like this:

class InferenceConfig(CustomConfig):
    GPU_COUNT = 1
    IMAGES_PER_GPU = 1
    IMAGE_MIN_DIM = 512
    IMAGE_MAX_DIM = 512
    DETECTION_MIN_CONFIDENCE = 0.85
    

inference_config = InferenceConfig()
model = modellib.MaskRCNN(mode="inference", 
                          config=inference_config,
                          model_dir=MODEL_DIR)

vanishab23 avatar Sep 28 '23 08:09 vanishab23