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

Error when checking input: expected input_image_meta to have shape (18,) but got array with shape (16,) during last step #164

Open
e76971072 opened this issue Jan 22, 2023 · 1 comment

Comments

@e76971072
Copy link

order = _validate_interpolation_order(image.dtype, order)
100/100 [==============================] - ETA: 0s - batch: 49.5000 - size: 4.0000 - loss: 2.1849 - rpn_class_loss: 0.1415 - rpn_bbox_loss: 0.6310 - mrcnn_class_loss: 0.1085 - mrcnn_bbox_loss: 0.6098 - mrcnn_mask_loss: 0.6940

ValueError Traceback (most recent call last)
in
----> 1 vis_img.train_model(num_epochs = 100, augmentation=True,path_trained_models = "/content/drive/MyDrive/Background-Image-Processor-Reseller/BackGround-Image-Processor-Reseller/Beanie/models")

9 frames
/usr/local/lib/python3.8/dist-packages/keras/engine/training_utils_v1.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
640 for dim, ref_dim in zip(data_shape, shape):
641 if ref_dim != dim and ref_dim is not None and dim is not None:
--> 642 raise ValueError('Error when checking ' + exception_prefix +
643 ': expected ' + names[i] + ' to have shape ' +
644 str(shape) + ' but got array with shape ' +

ValueError: Error when checking input: expected input_image_meta to have shape (18,) but got array with shape (16,)

Code snippet

vis_img = instance_custom_training()
vis_img.modelConfig(network_backbone = "resnet101", num_classes= 5, batch_size = 4)
vis_img.load_pretrained_model("mask_rcnn_coco.h5")
vis_img.load_dataset("./Beanie")
vis_img.train_model(num_epochs = 100, augmentation=True,path_trained_models = "models")

Can you anyone help me resolve this error ? somehow it couldn't save the weights during last epoch run.

@palvors
Copy link

palvors commented Feb 20, 2023

because for no reason, your Test dataset and training dataset should have same number of class in theirs cocodataset file... For me test missing one class ( 5) compare 6 for training, I added a picture about this classes in test and all it was correct after

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

2 participants