I'm trying to classify images data of blood and its spo2 value (oxygen percent in blood), spo2 value has 4 classes
X_train.shape => (8969, 224, 224, 3)
y_train.shape => (8969,)
output of model will be the percent of spo2
y_train.shape
>>> array([98, 98, 95, ..., 98, 95, 98])
Model Architecture
X_train = np.array(X_train)
y_train = np.array(y_train)
model = Sequential()
model.add(Conv2D(filters=64 , kernel_size=(3,3), activation='relu' , input_shape = (X_train.shape[1:])))
model.add(MaxPool2D(pool_size=(3,3)))
model.add(Conv2D(filters=32 , kernel_size=(3,3), activation='relu'))
model.add(MaxPool2D(pool_size=(3,3)))
model.add(Dense(units=512 , activation='relu'))
model.add(Dense(units=128 , activation='relu'))
model.add(Dense(units=4, activation='softmax'))
model.compile(optimizer='adam' , loss='categorical_crossentropy' , metrics=(['accuracy']))
history = model.fit(X_train , y_train , epochs=5)
error appears when fit the model
ValueError: Shapes (None,) and (None, 24, 24, 4) are incompatible