Week 2 dls course 1!

My problem error is “train_set_x_orig” not defined.

m_train = train_set_x_orig.shape[0]
m_test = test_set_x_orig.shape[0]
num_px = test_set_x_orig[0].shape[0]


print ("Number of training examples: m_train = " + str(m_train))
print ("Number of testing examples: m_test = " + str(m_test))
print ("Height/Width of each image: num_px = " + str(num_px))
print (“Each image is of size: (” + str(num_px) + ", " + str(num_px) + “, 3)”)
print ("train_set_x shape: " + str(train_set_x_orig.shape))
print ("train_set_y shape: " + str(train_set_y.shape))
print ("test_set_x shape: " + str(test_set_x_orig.shape))
print ("test_set_y shape: " + str(test_set_y.shape))m_train = train_set_x_orig.shape[0]
m_test = test_set_x_orig.shape[0]
num_px = test_set_x_orig[0].shape[0]

Try “Cell → Run All Above” and then run that cell again. The point is that every time you open the notebook, you need to run all the cells that define variables or import packages. Just having the code sitting there does nothing, until you run it.

Please whenever I try to load my assignments, I keep getting this. Please what do I do to fix it? Thank You!

Hi @Rizama_Victor ,

Please check your system time is correct. Some learners who have had this problem managed to fix that after correcting the system time.

In addition to making sure that your system time is correct, also note that there is an automatic “idle timeout” on the notebooks. I’m not sure the exact timeout duration, but it’s on the order of 5 or 10 minutes with no activity causes the notebook to drop the connection to the server or “kernel” and you get that “pop up” error that you show. But clicking “Reopen” should bring it back to life and you shouldn’t lose any work. At least that’s the way it works for me. Did you try just clicking “Reopen”? Did you get an error when you did that?

BTW this and the other “name not found” error in the earlier post on this thread are all explained in the DLS C1 W2 lecture “A Quick Tour of the Jupyter Notebooks”. If this is your first time using Jupyter Notebooks and you skipped that lecture to save time, it is worth a look.

Thank you very much for your response. It was really helpful :blush: :innocent:The issue was with my system time. It wasn’t corresponding with the time zone in my coursera account. I already fixed it. Best regards!