keras-unet-collection
keras-unet-collection copied to clipboard
I have a question about the shapes incompatible error.
I downloaded the COCO dataset and tested it as in the example. I create a dataset and an error occurs in the train code.
...
record = np.mean(keras.losses.categorical_crossentropy(valid_label, y_pred))
...
loss_ = model.train_on_batch([train_input,], [train_label,])
Error : Shapes (2069, 128, 128, 2) and (2069, 128, 128, 3) are incompatible.
How do I solve it?
Have you configured your model to accept two input channels and test it with data that has three channels?
Have you configured your model to accept two input channels and test it with data that has three channels?
I tested the same as "Human-seg_atten-unetbackbone_coco.ipynb" source code. The source code is as below.
valid_input = input_data_process(utils.image_to_array(valid_input_names, size=128, channel=3))
valid_label = target_data_process(utils.image_to_array(valid_label_names, size=128, channel=1))