The function used to build the model:
def CancerModel(input_shape):
X_input = Input(input_shape)
X = ZeroPadding2D((2, 2))(X_input)
X = Conv2D(8, (5, 5), strides = (1, 1), name = 'conv')(X)
X = BatchNormalization(axis = 3, name = 'bn1')(X)
X = Activation('relu')(X)
X = MaxPooling2D((2, 2), name='max_pool')(X)
X = Conv2D(16, (5, 5), strides = (1, 1), name = 'conv2')(X)
X = BatchNormalization(axis = 3, name = 'bn2')(X)
X = Activation('relu')(X)
X = MaxPooling2D((2, 2), name='max_pool2')(X)
X = Flatten()(X)
X = Dense(120, activation='relu', name='fc1')(X)
X = Dense(84, activation='relu', name='fc2')(X)
X = Dense(7, activation='softmax', name='output')(X)
model = Model(inputs = X_input, outputs = output, name='CancerModel')
return model
The model was attempted to be created using:
cancerModel = CancerModel(X_train.shape[1:])
However, I am getting an error saying that the attribute can't be set. I have also attached a screenshot of the error I'm getting. Any help would be appreciated.