C1W4 - There was a problem compiling the code from your notebook. Details: name 'load_img' is not defined

Hi tutor,

Would like your kind help on C1W4. I was able to run the whole code inside the Jupyter Notebook, but after clicking submit the assignment, below error occurred:


I’ve tried two ways to import load_img, but neither worked:

from tensorflow.keras.preprocessing.image import load_img,img_to_array
from tensorflow.keras.utils import load_img,img_to_array

Hope you can help me!

Thanks,

@suzyqw
Hi, welcome to the community :wink:
This error occurs because probably you have changed some parts of the code you were not supposed to. Try this (Section: Refresh your Lab Workspace) to get a fresh copy of the notebook and then resubmit it.