qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.
MIT License
4.73k stars 1.03k forks source link

Problem with fitting model #511

Closed Theedon closed 2 years ago

Theedon commented 2 years ago

I have an issue with when i try to fit my model, i keep getting that says dimensions are not equal

Dimension 1 in both shapes must be equal, but are 64 and 63. Shapes are [16,64,64] and [16,63,63]. for '{{node model_5/decoder_stage0_concat/concat}} = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32](model_5/decoder_stage0_upsampling/resize/ResizeNearestNeighbor, model_5/stage4_unit1_relu1/Relu, model_5/decoder_stage0_concat/concat/axis)' with input shapes: [16,64,64,512], [16,63,63,256], [] and with computed input tensors: input[2] = <3>.

Call arguments received:
  • inputs=['tf.Tensor(shape=(16, 64, 64, 512), dtype=float32)', 'tf.Tensor(shape=(16, 63, 63, 256), dtype=float32)'
Theedon commented 2 years ago

Thanks, I'll try that

Theedon commented 2 years ago

What fixed this problem eventually was changing the dimensions of all of my data(image and masks) to a multiple of 64, it appears some of the models only accepts those sizes as input.