C4_W2 Assignment : Grading problem

Hello, sorry if I posted this in a wrong way because this is my first time posting in this forum.

I have a problem in the assignment that after i try multiple times i think it related to the grading.

so here is the result of my loss and etc :
loss: 0.0051 - accuracy: 0.7795 - val_loss: 0.0050 - val_accuracy: 0.7976
from this I already fulfilled the condition of the 100/100 grading but when I submit my model it resulted in this error

all of them have the same error, I already try everything. Changing my model couple of times and all of them fulfilled the requirement, changing the version, using 2.15 version, 2.8 version and 2.9 version mymodel.h5 but still failed

# Install packages for compatibility with the autograder

# NOTE: You can safely ignore errors about version incompatibility of
# Colab-bundled packages (e.g. xarray, pydantic, etc.)

!pip install tensorflow==2.8.0 --quiet
!pip install keras==2.8.0 --quiet

I never change anything inside the colab and only change what’s needed to be changed. This problem almost the same as C3W1_assignment so I check the notebook for reference and I already did what I do for solving the problem but failed again.

So please anyone help me, this is the last assignment for me to complete the specialization.

1 Like

i got it… already solve it… if you guys have any problem related to this just put this cell at the start of the colab then restart the session.

# Install packages for compatibility with the autograder

# NOTE: You can safely ignore errors about version incompatibility of
# Colab-bundled packages (e.g. xarray, pydantic, etc.)

!pip install tensorflow==2.8.0 --quiet
!pip install keras==2.8.0 --quiet

then of course the training gonna be long right??? yes because you cant use GPU. BUT, if you use steps_per_epoch, validation_steps and set these 2 to 1-5 steps its going to make the training faster and still get good result with like 0-10+ sec training per epoch.

at the end comment these cells :

#import tensorflow as tf

# Check if you have the correct Tensorflow version
#assert tf.__version__ == '2.8.0', f'You have TF{tf.__version__}. Please install the grader-compatible Tensorflow and select Runtime > Restart Session'
# Load the model you saved earlier
#model = tf.keras.models.load_model("temp_model.h5", compile=False)

and of course cell below because you already put it at the start of the colab.

# Install packages for compatibility with the autograder

# NOTE: You can safely ignore errors about version incompatibility of
# Colab-bundled packages (e.g. xarray, pydantic, etc.)

#!pip install tensorflow==2.8.0 --quiet
#!pip install keras==2.8.0 --quiet

at the end of the colab only run this 2 cells after training :

# Save the model with the compatible TF version
model.save("mymodel.h5")
# You can also use this cell as a shortcut for downloading your model
from google.colab import files
files.download("mymodel.h5")

AND THE PROBLEM IS SOLVEDDDD ( for me :smiley: ) so if anyone also have this problem try this

1 Like

@Rivaldo,
Thanks for bringing this up - and providing a work-around.

Of course, you shouldn’t have to be going through those steps. The assignment was recently updated to help work around the GPU issue, but there might be something not quite right for this assignment. I did a quick check and am seeing the same issue you ran into.

It looks like the assignment may need another tweak. In the meantime, we have your work-around.

2 Likes

Hi Rivaldo! Thank you for reporting! There was a missing line (model.compile()) for this assignment that caused the error you encountered. It’s now added so other learners can continue using the same structure and utilize the GPU for training. Thanks again!

4 Likes

Hi again Rivaldo. You may run into a similar issue in Week 3 in case you’re already working on it. If so, please re-open the notebook from your classroom to see the latest changes. You will have to use the fallback runtime for this assignment. Thank you.

2 Likes

@chris.favila
I got similar grader problem “There was a problem grading your submission. Check stderr for more details.” even though i satisfied the required loss and accuracy.

loss: 6.0028e-04 - accuracy: 0.8763

Hi. Can you send me your notebook via direct message? Thanks.