How to clear cache in workspace

Hi, I am currently working on week 1 of course 4. I made quite some error before arriving to correct answers. But when I run the cell, the previous errors which I made(the code lines that I had deleted) are still displayed in the output as errors.

So I though of clearing the workspace. I tried restarting the kernel but of no use.

Please someone suggest me an idea.

For instance, when I run one of the cell that contains some code like

YOUR CODE STARTS HERE
# some code 
YOUR CODE ENDS HERE

but when I run it I get error like

# YOUR CODE STARTS HERE
---> 25     s = a_slice_prev * W

ValueError: operands could not be broadcast together with shapes (3,2,4) (3,3,4) 

Where I don’t even have variable s in my new code, as I had modified it. But the cache somehow seems to exist

Hello @waze,

If you just want to “reset the memory”, then go to jupyter notebook’s menu bar, click “Kernel” > “Restart”. Then a new kernel is assigned to the notebook, and you may run all of your code cells from the beginning again.

If you feel like to get a new copy of the notebook, and move your solutions to it, then please follow these steps to get the new copy.

Cheers,
Raymond

1 Like

Hi @rmwkwok,

Thanks for your suggestion. I tried both ways, but still the issue remains. It shows output for the code I have changed in the cell. That is, it is still printing output of the bug code which makes me unable to submit the solutions

Can you share a screenshot of the whole error Traceback?

No, I think the issue is solved now after renaming the file and getting new version as suggested in the second method you shared. Thanks a lot for your help.

Okay, @waze :slight_smile:

Raymond