End result is not as expected - Week 1

Hi everyone,

I finished working on the assignment of week 1 and the resulted image is just not detailed and noisy.
Training for longer epochs did not improve the resulted image.
All my code is exactly as the labs and videos, did I choose the correct layers to transfer the style?


hi @ahmadhatahet

This is the only combination of layers that you have tried?

I think that you have so many layers in the style_layerds, and in my assignement, the instructions say that i must use the layer 88 as a content layer, you are using layer 89.

Something important, is that the features of the style are extracted in the initial layers of the model, and ypu are using very deep layers to obtain the features.

Hope it can help.

Thank you Pere for your reply.

I tried a couple of combinations for the style layers, like

Also tried the content layer to be ‘conv2d_88’, however, no luck.

I got the same picture over and over, even with higher number of epochs, like 25.

It is like, the style transformation stuck after a couple of epochs and do not improve any further.


This layer combination has more sense!

There should be an error somewhere else, really difficult to guess where it can be.
I’m convinced that increases the number of epochs isn’t going to solve, that must be something else.

Are you sure you are preprocessing the image properly?

Sorry I can’t help more with this.

1 Like

hi @ahmadhatahet,

Check the sequence of the summation of layers under 'content_and_style_layers '.
style_layers should come before content_layers, otherwise your extraction of outputs from the model would be incorrectly matched to style and content feature extraction functions.

content_and_style_layers = style_layers + content_layers

Hope this helps.


It’s important to assign the right list of layers to the right variables content_layers and style_layers. Their order is somewhat confusing. And style layers should go before the content layers in the final list.


The following style list allowed me to pass the assignment:

style_layers = ["conv2d_1", "conv2d_2", "conv2d_3", "conv2d_4", "conv2d_5"]