W4A2 Neural Style Transfer - train_step function

I have some trouble to solve exercise 6 in Neural Style Transfer assignment.
I have completed filling the blanks in train_step function,

and executing the above cell results in the following error.

It says ‘You always must run the last cell before this one.’, but what is the last cell?

It means “the previous cell”.

And, perhaps these instructions for compute_layer_style_cost() will be useful:

Thank you for your reply, but the error remains unsolved.
I think my codes written in train_step() function are quite straightforward and correct, but it still doesn’t work and gives the same error message.

Did you modify the code in compute_layer_style_cost() and then re-run all of the cells?

Problem solved!
The problem was that I used the following code in compute_layer_style_cost function
_, n_H, n_W, n_C = tf.shape(a_G),
instead of using X.get_shape().as_list().

Again, thank you for your accurate and quick reply!

That’s good news.

1 Like