From 1ca3f9fb5bd885f90c5b398b9007067edbe5a236 Mon Sep 17 00:00:00 2001 From: jason9075 Date: Wed, 13 Jun 2018 15:05:57 +0800 Subject: [PATCH] in Keras 2.2.0 vgg16 have different layer index --- cnn_class2/style_transfer3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cnn_class2/style_transfer3.py b/cnn_class2/style_transfer3.py index bc12d49c..d0e00cd0 100644 --- a/cnn_class2/style_transfer3.py +++ b/cnn_class2/style_transfer3.py @@ -77,8 +77,8 @@ def load_img_and_preprocess(path, shape=None): # create the content model # we only want 1 output # remember you can call vgg.summary() to see a list of layers -# 1,2,4,5,7-9,11-13,15-17 -content_model = Model(vgg.input, vgg.layers[13].get_output_at(1)) +# 0,1,3,4,6-8,10-12,14-16 +content_model = Model(vgg.input, vgg.layers[12].get_output_at(1)) content_target = K.variable(content_model.predict(content_img))