Since I can’t upload code, let me just describe the model:
Conv2D(64, (3,3), activation=‘relu’, input_shape=(28, 28, 1))
MaxPooling2D(2, 2)
Conv2D(128, (3,3), activation=‘relu’)
MaxPooling2D(2,2)
Flatten()
Dropout(0.2)
Dense(512, activation=‘relu’)
Dense(1, activation=‘softmax’)
optimizer = ‘rmsprop’,
loss = ‘categorical_crossentropy’,
metrics=[‘accuracy’]
If I put more than 1 neuron in 2nd dense layer then I get value error.
Removing the dropout layer still gives similar results
I tried adding more conv2d layers but not much of a difference
My notebook got 100/100 from the grader but I am just not satisfied with the accuracy. Please help
I took this course many years ago and don’t have access to the current notebooks, but is this MNIST data? Guessing from the input shape. If so, don’t you need/want the output layer to have a dimension of 10? And if that causes a conflict with your chosen loss function, the solution isn’t to change the output dimension…it’s to choose a suitable loss function.
My take is that the real issue with your plot isn’t the low accuracy number, which is an effect, not a cause. The flat line means the network isn’t learning at all. Which means a fundamental problem with the model. Take a look here for some guidance on choice of loss function:
Use this crossentropy loss function when there are two or more label classes. We expect labels to be provided in a one_hot representation. If you want to provide labels as integers, please use SparseCategoricalCrossentropy loss
I am also facing similar problem. The loss is showing as nan (and you could have gotten 0 loss on the plot because of this). Please let me know if you have fixed the issue.