title: Mask Rcnn model Shape Error when loading the model for prediction in streamlit
body: <pre><code>ValueError: Layer #391 (named &quot;mrcnn_bbox_fc&quot;), weight &lt;tf.Variable 'mrcnn_bbox_fc_1/kernel:0' shape=(1024, 324) dtype=float32&gt; has shape (1024, 324), but the saved weight has shape (1024, 24).
  </code></pre>
  <p>I've trained the MASK-RCNN model on a custom dataset with 5 classes. When I perform inference on the model in a notebook and load the model weights using MASK-RCNN <code>modelib</code> it works fine.</p>
  <pre><code>model = modellib.MaskRCNN(mode=&quot;inference&quot;, model_dir=MODEL_DIR, config=config)
  
  model.load_weights(weights_path, by_name=True)
  </code></pre>
  <p>But when I load the model using this code it throws the error above.</p>
  <pre><code>import pixellib
  from pixellib.instance import instance_segmentation
  import cv2
  import os
  
  def do_instance(img_path):
      absolute_path = os.path.abspath(&quot;model/mask_rcnn_coco.h5&quot;)
      segment_image = instance_segmentation(infer_speed=&quot;average&quot;)
      segment_image.load_model(absolute_path)
      # Perform instance segmentation
      segmask, output = segment_image.segmentImage(img_path, show_bboxes=True)
      return output
  </code></pre>