Problem in: Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and - Week 3: Improve MNIST with Convolutions

I get to be graded 0 on the convolutional_model section. In more details, I get this: There was a problem grading your submission. Details:
name ‘training_images’ is not defined.
On the cell 2, there is:
(training_images, training_labels), _ = tf.keras.datasets.mnist.load_data(path=data_path)
Any help is appreciated.

1 Like

@chris.favila Based on tensorflow-1-public/C1W3_Assignment.ipynb at main · https-deeplearning-ai/tensorflow-1-public · GitHub, this seems to be a grader error.

so…by my side i cannot do nothing to cope with this mistake.It is a blocking one to complete the certification… :frowning:

Consider chatting with

There’s no harm in moving forward while trying to resolve this issue.

yes, you are right but I cannot understand why i am having this error!! :frowning:

Hi @Andrea_Maiellaro, send me a DM with the notebook you submitted and I’ll take a look

Posting solution here so other learners can check it, if needed.

So the issue here is that you are using the global variable training_images , within the convolutional_model function. The grader wipes out all of global scope so this variable ends up not being defined and that is why you are getting that error. You should instead explicitly define the input_shape as input_shape=(28, 28, 1) or whatever is the case for this exercise.

Going forward you should know that all graded functions have all the parameters they need to be run correctly so that is a good way of knowing which variables they rely upon but in general don’t use global variables within the graded functions. Hopefully this makes the error msg clearer :slight_smile: