You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "C:\Users\mehra\anaconda3\envs\gis2\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "C:\Users\mehra\OneDrive\Desktop\deep_learning\tf_keras\semantic_segmentation\model.py", line 116, in model_application
base_model = unet_collection(pixels, n_classes, activation, backbone_model_name, main_model_name, weights)
File "C:\Users\mehra\OneDrive\Desktop\deep_learning\tf_keras\semantic_segmentation\models_code\unet_collection.py", line 78, in unet_collection
base_model = kuc_model.vnet_2d((pixels, pixels, 3), filter_num=[64, 128, 256, 512], n_labels=n_classes,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 225, in vnet_2d
X = vnet_2d_base(X, filter_num, res_num_ini=res_num_ini, res_num_max= res_num_max,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 165, in vnet_2d_base
X = vnet_right(X, [X_skip[i],], f, res_num=res_num_list[i],
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 82, in vnet_right
X = Res_CONV_stack(X, X_skip, channel, res_num, activation=activation,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection\layer_utils.py", line 271, in Res_CONV_stack
X = add([X_skip, X], name='{}_add'.format(name))
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\layers\merge.py", line 791, in add
return Add(**kwargs)(inputs)
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\layers\merge.py", line 78, in _compute_elemwise_op_output_shape
raise ValueError(
ValueError: Inputs have incompatible shapes. Received shapes (32, 32, 512) and (32, 32, 256)
The text was updated successfully, but these errors were encountered:
The bug still be present. I fixed with this lines: if X.shape[-1] != X_skip.shape[-1]: X_skip = Conv2D(channel, (1, 1), padding='same', use_bias=False, name='{}_conv_match'.format(name))(X_skip)
inside Res_CONV_stack method.
I tested all of the models and they all worked fine, except the vnet_2d:
model.vnet_2d((128, 128, 3), filter_num=[64, 128, 256, 512], n_labels=7,
res_num_ini=1, res_num_max=3, activation='ReLU',
output_activation="Softmax",
batch_norm=True, pool=True, unpool=True,
name='vnet')
Traceback (most recent call last):
File "C:\Users\mehra\anaconda3\envs\gis2\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "C:\Users\mehra\OneDrive\Desktop\deep_learning\tf_keras\semantic_segmentation\model.py", line 116, in model_application
base_model = unet_collection(pixels, n_classes, activation, backbone_model_name, main_model_name, weights)
File "C:\Users\mehra\OneDrive\Desktop\deep_learning\tf_keras\semantic_segmentation\models_code\unet_collection.py", line 78, in unet_collection
base_model = kuc_model.vnet_2d((pixels, pixels, 3), filter_num=[64, 128, 256, 512], n_labels=n_classes,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 225, in vnet_2d
X = vnet_2d_base(X, filter_num, res_num_ini=res_num_ini, res_num_max= res_num_max,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 165, in vnet_2d_base
X = vnet_right(X, [X_skip[i],], f, res_num=res_num_list[i],
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection_model_vnet_2d.py", line 82, in vnet_right
X = Res_CONV_stack(X, X_skip, channel, res_num, activation=activation,
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras_unet_collection\layer_utils.py", line 271, in Res_CONV_stack
X = add([X_skip, X], name='{}_add'.format(name))
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\layers\merge.py", line 791, in add
return Add(**kwargs)(inputs)
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\mehra\anaconda3\envs\gis2\lib\site-packages\keras\layers\merge.py", line 78, in _compute_elemwise_op_output_shape
raise ValueError(
ValueError: Inputs have incompatible shapes. Received shapes (32, 32, 512) and (32, 32, 256)
The text was updated successfully, but these errors were encountered: