C2W1_Assignment Graded Functions Mishaps

Hey fam, these errors seem odd to me, can anyone advise? cheers

Details of failed tests for create_train_test_dirs

Failed test case: create_train_test_dirs has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
[Errno 2] No such file or directory: ‘/tmp/cats-v-dogs/testing’.

Details of failed tests for create_model

Failed test case: create_model has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

Hi @Fabian_b, DM me a copy of your notebook and I will take a look.

Hi @Fabian_b, I submitted your assignment and got these error messages instead:

Details of failed tests for create_train_test_dirs
Failed test case: testing/cats subdirectory was not found.
Expected:
True,
but got:
False.
Failed test case: testing/dogs subdirectory was not found.
Expected:
True,
but got:
False.
Failed test case: training/cats subdirectory was not found.
Expected:
True,
but got:
False.
Failed test case: training/dogs subdirectory was not found.
Expected:
True,
but got:
False.
All tests passed for split_data!
Details of failed tests for train_val_generators
Failed test case: There was an error grading this function. Details shown in ‘got’ value below:.
Expected:
no exceptions,
but got:
name ‘TESTING_DIR’ is not defined.
All tests passed for create_model!

This is consistent with what I see in the code. In the create_train_test_dirs function you are hardcoding the paths instead of using the parameter provided for the function. This graded function is unit-tested using the parameters that it has so hardcoding paths fails the tests.

For train_val_generators you are using the global TESTING_DIR instead of the local VALIDATION_DIR .

Also when compiling the model you are using acc instead of accuracy which will result in an error when uploading the training history.

will update corrections

changed hardcoded variables however still getting
ould not parse values for training accuracy from history.
Expected:
True,
but got:
False.

I am using ‘acc’ instead of 'accuracy’

You need to use accuracy to avoid that error. Notice that the training history is a normal Python dictionary so if you want to avoid re-training just change the key from acc to accuracy and then save the pickle file.

when i use accuracy, it throws an error in colab and it still doesnt work on the grader. if i use acc it works on colab but the graders doesnt pick up on it. please advise

You need to set the metric when compiling the model within the create_model function. Or you could also add a new key to the dictionary called accuracy with the same values that acc key has.

yes! thank you! it works!