Programming assignment error in Week 2

In week 2 programming assignemet, I got the cells run correctly almost till the end . But when I’m trying to rerun from the beginning, I’m getting the following error at the second cell.
NameError: name ‘train_set_x_orig’ is not defined
Why this error is coming up now? It was not there when I first ran it.

There are two assignments in Course 1 Week2. Which one are you asking about?

Second one. The one to submit for grading

@Neetha, took a look at this and this is not even code you need to touch. This is just the basic load of the dataset.

Keep in mind even if you’ve done some work on the lab it is good practice to run all the previous cells again each time you open it, because whether they are instantiated in the present instance turns out to be a mixed bag.

Personally, I have also sometimes found some issues with the ‘run to cell(s)’ dropdown command, but doing ‘shift-enter’ and just plowing through the notebook always works.

When i try to run all cells from beginning only I’m getting the above error and I’m stuck.

Hi @Neetha ,

It would help to do a clean run:
kernel->restart and clear all output
cell → run all

What is happening here is that your execution environment is out of sync. By doing a restart and clear all output will help to make sure your code is executing in a clean state.

Let’s know if it still doesn’t work.

tried the above.
still not working :frowning:

Hi @Neetha,

Please check your direct message for instruction.

Problem resolved. Now it’s working. Thanks a lot