0

I have a project where I want to do feature extraction in images. I have this CNN layer:

model = keras.Sequential(
[
    layers.Input((2*imsize,imsize,3)),   
    layers.Reshape((2,imsize,imsize,3)), # Splits image into 2 with 3 dimensions        
    layers.LayerNormalization(axis=[-1,-2,-3]),  

    # CNN Layers 
    layers.SeparableConv2D(32, (3, 3), activation='relu'),
    layers.MaxPooling2D(pool_size=(2, 2)),
    layers.SeparableConv2D(32, (3, 3), activation='relu'),
    layers.MaxPooling2D(pool_size=(2, 2)),
    layers.SeparableConv2D(64, (3, 3), activation='relu'),
    layers.MaxPooling2D(pool_size=(2, 2)),

    layers.Flatten(),                             
    layers.Dropout(rate=0.7),                            
    layers.Dense(16,activation='relu'),           
    layers.Dense(2,activation='softmax')          
])

Though I am getting this error

Kernel shape must have the same length as input, but received kernel of shape (3, 3, 3, 32) and input of shape (None, 2, 64, 64, 3). Arguments received by SeparableConv2D.call():
     • args=('<KerasTensor shape=(None, 2, 64, 64, 3), dtype=float32, sparse=False, 
    name=keras_tensor_141>',)
     • kwargs=<class 'inspect._empty'>

I have trouble in understanding how to fit the LayerNormalization layer into SeparableConv2D. Any help on what I am doing wrongly?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.