UResNet Error: ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis.
See original GitHub issueI am trying to create an Unet with the following code:
img_size_ori = 101
img_size_target = 197
model = UResNet34((img_size_target, img_size_target, 3))
But then I got this error message:
Traceback (most recent call last):
File ".\main_unet.py", line 24, in <module>
model = UResNet34((img_size_target, img_size_target, 3))
File "F:\Workspace\kaggle\Salt Identification\model\segmentation_models\unet\models.py", line 40, in UResNet34
activation=activation, **kwargs)
File "F:\Workspace\kaggle\Salt Identification\model\segmentation_models\unet\builder.py", line 38, in build_unet
x = up_block(filters, i, upsample_rate=up_size, skip=skip, **kwargs)(x)
File "F:\Workspace\kaggle\Salt Identification\model\segmentation_models\unet\blocks.py", line 27, in layer
x = Concatenate()([x, skip])
File "F:\Anaconda\lib\site-packages\keras\engine\base_layer.py", line 431, in __call__
self.build(unpack_singleton(input_shapes))
File "F:\Anaconda\lib\site-packages\keras\layers\merge.py", line 354, in build
'Got inputs shapes: %s' % (input_shape))
ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 14, 14, 512), (None, 13, 13, 256)]
Thanks for this nice repository.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
A `Concatenate` layer requires inputs with matching shapes ...
ValueError : A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 523, 523, 32), etc....
Read more >A`Concatenate`layer requires inputs with matching shapes ...
Hello ValueError occurred when start learning tlt-yolo. Size of the training image is 1280 x 720. The below error occurred when setting ...
Read more >Concatenate layer - Keras
Layer that concatenates a list of inputs. It takes as input a list of tensors, all of the same shape except for the...
Read more >A 'Concatenate' Layer Requires Inputs With Matching Shapes
Ask questionsUResNet Error: ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. I am trying to create an...
Read more >"concat" mode can only merge layers with matching output ...
When concatenating two tensors along a specific axis, all other dimensions except the one being concatenated must be the same.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Height and width of input images should be divisible by 32 for all models
I think this is due to the wrong concatenation of layers. in model.summary() find out the correct layers to concatenate. I will post the correct code in my repository tomorrow or day after tomorrow…