C2M4_Assignment

Verification Run is OK, but this:

unittests.exercise_4(run_training, ChestXRayDataModule, ChestXRayClassifier)

Returns:

Failed test case: Your function failed to execute during the test. Error: [Errno 2] No such file or directory: ‘dummy_weights.pth’.
Expected: None
Got: None

Anybody else run into the similar issue?

Sorry, but what do you mean “Verification Run is OK”? The failure you show is from running a test cell in the notebook itself. Are you sure you ran all the previous cells in order? Try this and see if it changes the behavior:

Kernel -> Restart and Clear Outputs
Cell -> Run All

If it still fails with that “File not found” error, then it’s time to look at the actual test code to understand what it is doing.

Found the error, I made mistake in the very definition of class ChestXRayClassifier - incorrect def. of self.model (path parameter).

Even with that mistake, unittests.exercise_2(ChestXRayClassifier) tests passed, so I did not look there at first.

Case closed.

1 Like

Hi,

On the same topic related to C2M4 assignment, there is maybe an issue with the provided assignment files. In the exercise 1 the import of the helper_utils.py it is not importing a function create_datasets and as the setup of the object at line dm_verify.setup() it is failing. Just wanted to raise the issue.

Thanks in advance

The create_datasets function is not in helper_utils.py: it is defined in the main notebook itself. Are you sure you didn’t accidentally convert that cell from code to markdown? Do a text search in the notebook to find that string and take a look at the type of that cell. Or perhaps you accidentally changed the name of the function. If there have been accidental modifications to the notebook, you might want to start over with a clean copy just to be on the safe side.

Well, there might be a simpler explanation: are you sure you actually ran that cell (the one that defines create_datasets)? Just calling the function does not run the cell. Everytime you restart the notebook, you need to run all the cells to recreate the runtime state. Try:

Cell -> Run All Above

and then retry the cell that calls create_datasets. Just having a cell containing a function sitting there does nothing until you actually execute that cell in order to get the code loaded.

you’re right thank you for the quick update. The function is defined in the notebook but I had by mistake changed the cell as a markdown.

1 Like