TF1 Course 3 Week 4 Assignment Grader Error

Hi, I try to submit Week 4’s assignment but there is a grader error. I get 50 points from my training history, but I can not complete graded functions.

Here is the error:
Details of failed tests for n_gram_seqs

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘n_gram_seqs’.

Details of failed tests for pad_seqs

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘pad_seqs’.

Details of failed tests for features_and_labels

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘features_and_labels’.

Details of failed tests for create_model

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘create_model’.

Hello @orh0n ,

Welcome to the community!!!

Send me your notebook via dm such that I can check where it went wrong.By clicking on the profile picture, you will see an option to message.There you can attach your notebook.Then we can discuss the issues here, under the topic you created, on discourse.

With regards,
Nilosree Sengupta

I have same issue.
exactly same messages and 0 for graded function.
I’ll send you my file

Hello @violkim ,

  1. At first I would ask you to get a fresh copy of the assignment, I fixed errors of your file then uploaded. But it gave the same errors.It may be that your notebook lost part of important metadata which is essential for the grader.
    Then I took a fresh copy and wrote the same, fixing your errors , it passed with 100%.

Modifications to be made :

2. Under # GRADED FUNCTION: pad_seqs
You need to return pad_sentences as a numpy array here using np.array. You haven’t done that.

It’s given in the hint :

Notice that this function receives a list of sequences and should return a numpy array with the padded sequences.

3. Under # Train the model,

You have changed the epochs from 50 to 500 to get it above 80%, because to pass this assignment, accuracy of at least 80% is required, but your architecture is giving around 50% after completing the 50th epoch.

You are only supposed to write code for where it’s mentioned like within this :

   ### START CODE HERE
....
....
    ### END CODE HERE

Dont modify anything else.
Keep it epochs=50.

Solution to this is also written in the hint :

If your model didn’t achieve this threshold, try training again with a different model architecture, consider increasing the number of units in your LSTM layer.

So you need to do that.

4. Under # GRADED FUNCTION: create_model :
You have used
Bidirectional(LSTM(30))), Increase this to a larger number.

Doing these will perfectly give you 100%.
Happy learning!

Hope this helps.

With regards,
Nilosree Sengupta

1 Like

@Muhammad_Ali10

Your implementation is correct.

The expected output for:

print("\nfeatures look like this:\n")
first_features

is

array([[  0,   0,   0,   0,  34],
       [  0,   0,   0,  34, 417],
       [  0,   0,  34, 417, 877],
       [  0,  34, 417, 877, 166],
       [ 34, 417, 877, 166, 213]], dtype=int32)

The staff have been notified to fix this.

I am still getting this error

Details of failed tests for n_gram_seqs

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘n_gram_seqs’.

Details of failed tests for pad_seqs

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘pad_seqs’.

Details of failed tests for features_and_labels

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘features_and_labels’.

Details of failed tests for create_model

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
module ‘learner_mod’ has no attribute ‘create_model’.

Please click my name and message your notebook as an attachment.

Your notebook is missing grader metadata for all cells:

  "tags": [
    "graded"
  ],

Please check notebook metadata and refresh the workspace.