log0 / neural-style-painting

Implementing of the "A Neural Algorithm of Artistic Style"
236 stars 100 forks source link

Update #10

Open jxqhhh opened 6 years ago

jxqhhh commented 6 years ago

Without changing these indexes, the program will meet some errors.I think this may be caused by the change of VGG model downloaded from the website mentioned in READMD.md or something else like this.What's more,b = vgg_layers[0][layer][0][0][2][0][1] will return a numpy.ndarray of shape (1,None),so I decided to use b = tf.constant(b.T) in the code. Here is my test code to find out what vgg_layers looks like:

VGG_MODEL = 'imagenet-vgg-verydeep-19.mat' vgg = scipy.io.loadmat(VGG_MODEL) vgg_layers = vgg['layers'] vgg_layers[0][0][0][0][-2] array([[1]], dtype=uint8) vgg_layers[0][0][0][0][0][0][0] 'c' vgg_layers[0][0][0][0][0][0][1] 'o' vgg_layers[0][0][0][0][2][0][0].shape (3, 3, 3, 64) vgg_layers[0][0][0][0][2][0][1].shape (64, 1)