C1W2 assignment using a different dataset?

In the assignment, the model reaches 99% accuracy at the 9th epoch, but when I run the code used in the examples given during the week, using the same model architecture, I only get about 94% accuracy on the training data at the same epoch (I run in using a local notebook on my laptop). Where is the 5 percent difference coming from?

Hello @eyalhrz,

There is no guarantee that a model architecture can reach the same performance for any different datasets. Even training it on the same dataset but on different platform has some chance to get to different results.

It is better not to assume the same performance if you train with different dataset, unless you have a very strong reason to support your assumption.


I see, thanks for this input. I wanted to make sure that the dataset is the same. Indeed I trained on a whole different platform but still I expected less dramatic differences and was surprised to see such big differences for the same code.

Did you or did you not use a different dataset? You seemed to be saying you did use a different dataset in the title of this thread. Was it a different one or not?


What I actually meant is to ask whether the assignment makes use of a different dataset, not that I used a different one. Sorry for the confusion.

C1 W2 loads one dataset with the following code:


What is the second dataset that might or might not be different from this one? When you said “different”, I suppose you must be comparing between two datasets. Now the above is the first one, right? Where is the second one?


1 is from the ungraded lab (from this notebook: C1_W2_Lab_1_beyond_hello_world.ipynb)

(training_images, training_labels), (test_images, test_labels) = fmnist.load_data()

2 is from the graded assignment:
(x_train, y_train), _ = tf.keras.datasets.mnist.load_data(path=data_path)

of course the loading code is different but I’m asking about the dataset itself in both contexts

Thanks for the details @eyalhrz. By them I think you might have posted this thread in the wrong category, because MLS does not have that lab. Perhaps this is why I was confused.

I guess you are taking the Tensorflow Developer Professional specialization, so I have moved your thread to the TF1 Course 1 Week 2 category for you, and I will let their mentors or learners to take over from here.