C2W3 Assignment: I can't get over 99.9% accuracy

For this assignment, we should get over 99.9% accuracy for training data within 5 epochs. But, my model didn’t work. My model is showing 51.3% since 4 epochs. Whenever I test my code for each graded function, I got “All tests passed!”. I don’t know what’s wrong in my code.

1 Like

hi @vlfdmstmf

Try simple model rather than adding two many layers, also the best we to address when we don’t get the desired accuracy is to change in your model by what kind of layer selection is done, how many units have been used, does using dense layer has an affect and also with the activation for the kind of dataset you are working on, this assignment is basically to make you understand on basics of first understanding significance of feature related to a dataset and then how one should approach a dataset depending on it is simplicity to complexity.

If you want more precise hint, refer ungraded labs, in fact even the videos will give you hint on the model.

Let me know if you are not able to resolve issue.

Regards
DP

1 Like

I have the same issue

follow the same hint, if you still not getting the hint, then refer to a learner who tried different ways of model layering to know how it affects training

Hope it helps!!!

Regards
DP

I think there is a problem with parts of the code that we are unable to change. Based on the instructions, the code does not work after we complete it!

have you passed all the unittest before the model training?

you can mention the part of the code you are telling you cannot change with a screenshot as codes that are not allowed to be changed don’t come under grade cell but make sure you are not sharing any grade cell codes.

If the issue is not getting a desired accuracy with passing all the previous unittest, then making changes in your model should work around unless you try different model algorithms

After passing all unittest what I see is exactly the image that vlfdmstmf has shared in the first question, and the accuracy gets stuck at 0.5131

then you need work on model architecture as mentioned before

I passed all unittest. and in this assignment, we can’t change the model structure. We have to use ‘mixed7’ layer from ‘inception v3’ model as the last layer of the pre-trained model. And we have to use specific number of hidden units of a fully connected layer and dropout rate to get 100 grade.

how have you recalled your inputs? send code screenshot by personal DM

I found the issue
we didn’t use pre_trained_model.load_weights

1 Like

I already added the pre-trained weights. But still same issue.

pre_trained_model.load_weights(LOCAL_WEIGHTS_FILE)
pay attention to the capital letters

1 Like

Yeah. I know. I used the capital letters. So, is your model working now?

Yes

hi @vlfdmstmf

use loss as tf.keras.losses.BinaryCrossentropy()

let me know is there any change in your training.

Regards
DP

you have assigned weights as none. ok my bad sorry you did assign the local weights

1 Like

My model is working now. It’s so strange. I just restarted my computer and run my code again without any changing. and I got 100% accuracy. It’s a relief but it’s annoying about the fact that I spent lots of time for this. Anyway, thanks for all your help!

2 Likes