"There was a problem compiling the code from your notebook."

Hello I have an issue submitting my assignment notebook. Please help me asap.

  • Week 4
  • programming/jrt41/handling-complex-images
  • When submitting the notebook (that is completed and should pass the assignment) I get this error, I don’t know what to do :
    image

I think it is related to this : h t t p s : / /stackoverflow.com/questions/68881753/importerror-image-transformations-require-scipy-install-scipy
The fit function requires scipy, it didnt worked on my machine either with tensorflow 2.14 and python 3.10
This module missing could result in this error.

I think it is realted to this : “stackoverflow dot com/questions/68881753/importerror-image-transformations-require-scipy-install-scipy”
I didnt had this error on the coursera notebook lab but I had it on my machine. This scipy module missing in the kernel could result in a hist undefined error.

Yes, it is definitely the case that you need to have the right versions of everything installed on your local machine to get the notebooks to work locally. But your original post is about the grader, right? You can’t even submit to the grader from your local machine, can you? How would that even work?

I can, I just need to upload the notebook, save and then submit, I did it for every previous assigment I never had a problem until now.
Yes the problem is with the grader, I don’t know what’s wrong since the coursera lab is running the notebook correctly and properly.

Well where is the hist variable defined? If it did not throw that error when you run the tests locally, then the most likely theory is that there is something about your code that is not “general”: it works differently when the grader calls your functions with different test cases.

So the next step is to carefully consider the logic that defines hist: is there anything about that which depends on the state of other variables in the notebook that might be different in the grader test cases?

Or maybe you modified some other parts of the notebook not do with the code you need to write in order to get it to work on your local machine. You might want to get a clean copy of the assignment and very carefully copy over just your solution code from the “YOUR CODE HERE” segments.

I never had a problem until now.
Yes the problem is with the grader,

Working on a notebook locally, then uploading it back to Coursera for grading, is guaranteed to cause headaches. Maybe not on every assignment, but it will eventually.

Some toolsets will cause the notebook metadata to get mangled, and then the grader breaks. The metadata isn’t used very much within the notebook, but the grader relies on it.

I think not. If the notebook doesn’t include loading a specific package, that means it isn’t needed. For example, perhaps that assignment isn’t supposed to use scipy.

Don’t mess around with changes to the notebook that aren’t within a “START CODE HERE” section.

Do you happen to have the raw notebook I cannot find it anymore now that I have “updated” it (replaced it) ?
Maybe by updating the code on a fresh new notebook would work ?

Oh my bad you gave instructions. Im on it!

Use the File menu to rename your notebook.
Use “Help → Get latest version” to get a new copy.
Then use Kernel->Restart to clear the workspace.
Then you can open the new notebook and just copy-in the code you added.

Note: Do not block-copy the entire notebook, that will just preserve the problems.

Thank you all!! it worked!
Really thank you!
Have a great weekend!
image

2 Likes

That’s good news! So it sounds like the lesson learned here is what Tom mentioned earlier: it’s a mistake to work on the notebook on a different platform (your computer or Colab or …) and then to upload the modified notebook back to Coursera and expect it to work.

1 Like