Unable to make CNN model with same output and input dimensions
The error indicates that you are trying to add tensors of incompatible dimensions, as x has 128 channels and inputs has 3 channels.
The reason why x has 128 channels is just in the line above, where you pass feature_size with value 128 as the number of output channels. Change the number of output channels in that line to 3 and it should work, like this:
x = Conv2D(3, (3, 3), kernel_initializer='he_uniform', padding='same')(x)