Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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). #85

Closed
Dilshad737 opened this issue Jul 27, 2021 · 3 comments

Comments

@Dilshad737
Copy link

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.

@Dilshad737
Copy link
Author

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

@alcanunsal
Copy link

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

@mdrst
Copy link

mdrst commented Jan 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants