ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Layer #391 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc_3/kernel:0' shape=(1024, 12) dtype=float32> has shape (1024, 12), but the saved weight has shape (1024, 16).

Dilshad737 opened this issue · comments

Layer #391 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc_3/kernel:0' shape=(1024, 12) dtype=float32> has shape (1024, 12), but the saved weight has shape (1024, 16).

I annotated a few images to test it. I trained the model for 10 Epoch. When I run the inference code:

import pixellib from pixellib.instance import custom_segmentation segment_image = custom_segmentation() segment_image.inferConfig(num_classes= 2, class_names= ["BG", "dent", "rust", "scratch"]) segment_image.load_model("/content/mask_rcnn_models/mask_rcnn_model.008-0.073602.h5") segment_image.segmentImage("/content/drive/MyDrive/dataset/test/Dent3.jpg", show_bboxes=True, output_image_name="sample_out.jpg")

I got the following error.

Layer #391 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc_3/kernel:0' shape=(1024, 12) dtype=float32> has shape (1024, 12), but the saved weight has shape (1024, 16).

I am using google colab for this test.

It was my mistake I put wrong classes in inferConfig(). That's why I am closing this issue.

hi, could you explain what kind of a mistake you made while putting the classes? i'm having the same type of problem

so basically it is following this :
segment_image.inferConfig(num_classes= 2, class_names= ["BG", "dent", "rust", "scratch"])
and it has 3 which are dent rust and scratch