C4W4A2 ex.6 ERROR:AttributeError: 'list' object has no attribute 'get_shape'

I’ve used the compute_layer_style_cost function before train step but in train_step I got an error:
AttributeError: in user code:

<ipython-input-26-e9e1eb98ee23>:19 train_step  *
    J_style = compute_layer_style_cost(a_S, a_G)
<ipython-input-9-8eb7a2900b7f>:16 compute_layer_style_cost  *
    _, n_H, n_W, n_C = a_G.get_shape().as_list()

AttributeError: 'list' object has no attribute 'get_shape'

In train_step(), you should not call compute_layer_style_cost(). That’s the wrong function name.
You want to compute the entire style cost, not just the cost on one layer.

1 Like

Thanks for your Help.