When I submitted my assignment, I received a zero along with the following error message:
“There was a problem compiling the code from your notebook. Please check that you saved before submitting. Details: name ‘untrained_model’ is not defined.”
To address this, I tried defining “untrained_model” as a global variable, but this solution did not work. I also added the comment # grade-up-to-here in the last graded cell, and all graded cells passed successfully, giving me a score of 67%.
However, the original issue remains unresolved. I have since moved on to Weeks 3 and 4 and completed all the assignments, but I would like to understand how to fix this issue.
check if you used global variables in the assignment.
In the GRADED FUNCTION: train_mnist, you probably have used untrained_model function to recall your model.
For the below code lines instruction
# Create a compiled (but untrained) version of the model
# Hint: Remember you already coded a function that does this
You were suppose to use create_and_compile_model() from exercise 1, probably the instruction mentions untrained version confused you to use the incorrect function but that function was given in the assignment to provide you hint on how to create an untrained model rather than using it.