TF C3W3 assignment results *too good*

Hi,

I’ve passed the assignment with some strange results. My model achieves nearly perfect accuracy in the 1st epoch, and then =1.0 for all epochs, while val_accuracy=1.0 for all epochs.

Look at these weird images:
image
image

My model def is:

[edit]

I’ve replicated these results in PyCharm, so the problem is persistent.

I suspect there’s something wrong with the data. Any hypotheses?

Posting code in a public topic is discouraged and can get your account suspended. It’s okay to share stacktrace on a public post and send code to a mentor via direct message. Please clean up the post.
Here’s the community user guide to get started.

Click my name and message your notebook as an attachment.

Thank you for the warning! I edited out the code.

Your cost was essentially zero on the first epoch as well. So it’s probably not the data set.

There’s a mistake in parse_data_from_file. As a result, the entire dataset is considered to belong to a single label. Here’s how your label distribution looks:
image

This is how the label distribution should look:
image

1 Like

Thank you for your help, I will look into it as soon as possible!

One way you can get zero cost and 100% accuracy without doing any training is if the data set is all zeros, and the labels are all zeros. Then if the model is initialized with zero weights, it immediately knows that 0 = 0.

It parse_data_from_file indeed. It basically checked whether there is another type of data than there was. Corrected that already and it’s OK!

Thank you once again for your help, Balaji! It certainly was appreciated :slight_smile: