Hi Luis_Fernandez!
Welcome to the community .
Your implementation logic is correct! So I’m not sure what’s causing that error. Maybe I shall check the implementation, so please share the code snippet of that cell with me through private chat, let me look at it once.
Regards,
Nithin
Hi Andrew!
Welcome to the community .
In your case, there is no mistake in your implementation. I have cross-checked your code (which you sent me in private chat) by running it in my notebook too, and it works fine! I’m afraid that there might be some other issue. I request you to share your notebook through private chat.
Regards,
Nithin
Hi Hitarth!
Welcome to the community. I hope you are doing well. In this case, apparently, the learners did not have any errors in their implementation. It was strange as it was throwing an assertion error for Andrew, but when he restarted the kernel and when he ran all cells again it worked for him.
Can you elaborate more on the issue you are facing so that we can help you?
Regards,
Nithin
I basically get the same error as posted here! I tried to run it again and it still doesnt work. Please help me immediately because I have to finish this assignment tomorrow!
Hey Hitarh, sorry for the late reply. I was off for a few days. If the issue is still persisting then kindly share your notebook with me through Private Chat. I will check what’s happening in your case.
Regards,
Nithin
I have trouble to understand the nature of the assignment of week 1 and week2. We are given the python jupyter notebook and the code, and then there are errors - known as assertion error in
the generator block:
The test cases given in the notebook need not make sense with respect to the context. It is just given to check the implementation of our code (whether we have included all the necessities and have correctly written the code). Apart from that, the test cases don’t mean anything. So please don’t worry about the test cases, if it is throwing errors then it means that your implementation is not correct (make sure that you have included all the layers as given in the instructions).
Please feel free to post if you still face any issues.
@tom_tom1, to add a little more explanation about the unit tests - as @Nithin_Skantha_M explains, they are there to test your code to help you find problems early-on before you continue on to the next step.
The way unit tests generally work is that they call your function with a specific input and then check if the output is what is expected for that input. The assert statement is what checks if the output is what expected. If it’s not, it will raise an assertion error. Your job at that point is to go back and look at your implementation to figure out why it is not returning the expected result for the given input.
@peter4,
I’m not clear. Is there a problem you’re still seeing that you need help with? If so, can you share the error you’re getting, including the full stack trace?
Short answer: No I don’t need help with this problem. But this issue should be fixed for future learners.
Long answer: I passed this test few days ago and got Code Cell UNQ_C6: Function 'get_disc_loss' is correct.. Even though I haven’t change the code, I got the below error when running test_disc_loss().
Luckily, I have downloaded the notebook(test passed one). So I uploaded it and ran it but failed…
Finally I tried to refresh the notebook by following this instruction but it throws another error below. (I can refresh other notebooks like DCGAN’s one.)
Traceback (most recent call last): File “/usr/local/lib/python3.8/dist-packages/send2trash/plat_gio.py”, line 17, in send2trash f.trash(cancellable=None) gi.repository.GLib.GError: g-io-error-quark: Unable to find or create trash directory for /tf/C1W1_Your_First_GAN.ipynb (0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/local/lib/python3.8/dist-packages/tornado/web.py”, line 1704, in _execute result = await result File “/usr/local/lib/python3.8/dist-packages/tornado/gen.py”, line 234, in wrapper yielded = ctx_run(next, result) File “/usr/local/lib/python3.8/dist-packages/notebook/services/contents/handlers.py”, line 239, in delete yield maybe_future(cm.delete(path)) File “/usr/local/lib/python3.8/dist-packages/notebook/services/contents/manager.py”, line 279, in delete self.delete_file(path) File “/usr/local/lib/python3.8/dist-packages/notebook/services/contents/filemanager.py”, line 531, in delete_file send2trash(os_path) File “/usr/local/lib/python3.8/dist-packages/send2trash/plat_gio.py”, line 23, in send2trash raise OSError(e.message) OSError: Unable to find or create trash directory for /tf/C1W1_Your_First_GAN.ipynb
It seems I’ve hit a dead end. Since I have passed the test, I don’t need to re-pass the test.
I’ll let the staff know that file delete does not work for this notebook so they can get it fixed.
In the meantime, as a work-around, instead of deleting the file, you (or anyone else who runs into this issue) can just rename it. Once you’ve renamed it, you can add ?forceRefresh=true as suggested in the instructions, or you can click the “? Help” button in the upper right corner, and then choose “Get latest version”