Custom Models, Layers, and Loss Functions with TensorFlow week 1 C1W1_Assignment first weeks assignment

Custom Models, Layers, and Loss Functions with TensorFlow
Week 1
C1W1_Assignment
First week assignment
First i check the red wine and white wine dataset and passed



But I got an error message at utils.drop


I already try to delete all the files inside the directory and then reboot it and update it to get a fresh copy but the issue keep persists

hi @SteveFitrano2003

can you cross check your codes with this pinned comment debug points

Let me know if issue persists.

codes screenshot removed, against community guidelines
I’ve done the solution provided but it seems the issues still persist

please don’t post codes on public post. it is against community guidelines.

can you try restarting the kernel, and re-run the codes once. Do it after sometime.

or click File==> Open, then open utils.py file, go to the unittest you are failing, where it will provide information about why this unittest failed and reason behind the error

also can you confirm these compile parameters were selected in the final model


loss = {'wine_type' : 'binary_crossentropy',
                      'wine_quality' : 'mse'},

metrics = {'wine_type' : 'accuracy',
                 'wine_quality':
tf.keras.metrics.RootMeanSquaredError()}

Yes, i’ve checked it before it said mean squared error, and i’ve changed it but the issue still the same, i’ll try to restart the kernel

def test_df_drop(df):

test_cases = [
    {
        "name": "df.alcohol[0]_check",
        "result": df.alcohol[0],
        "expected": 9.4,
        "error_message": f'Value is not as expected. Please check quality interval.'
    },
    {
        "name": "df.alcohol[100]_check",
        "result": df.alcohol[100],
        "expected": 10.9,
        "error_message": f'Value is not as expected. Please check quality interval.'
    }
]

test_loop(test_cases)

the weird thing is every time i restart the kernel it keeps giving me different output/ result. is this normal? but i inferred since there is expected value it shouldn’t keep changing right?

ok this points you to check quality interval.

Can you DM screenshot of final model codes. Don’t post here.

by any chance, did you uncomment the below code

#df = df.iloc[np.random.permutation(len(df))]
1 Like

it works, i think it is because of the random permutation. Thank you so much for the solution


Sorry, i have another problem in the notebook the test_history is passed but when i check at the grader ouput it said taht the history is not defined

Why is this happen?

make sure you running all the cell one at a time after you restart your kernel

Perhaps you need to save the notebook before you submit for the grader!

2 Likes

Right @SteveFitrano2003, although notebook should autosave, but in some instances not saving also has caused such failed error output as you have made changes to notebook multiple times, make sure once you run the cell, save your work and then submit

2 Likes