Skip to content

Commit

Permalink
Fix for issue awentzonline#39. Transform weights from shape (64, 3, 3…
Browse files Browse the repository at this point in the history
…, 3) to (3, 3, 3, 64) for keras versions 2.0.0 and above.
  • Loading branch information
zkneupper committed Oct 17, 2017
1 parent a28f01e commit d38d662
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions image_analogy/vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def get_model(img_width, img_height, weights_path='vgg16_weights.h5', pool_mode=
g = f['layer_{}'.format(k)]
weights = [g['param_{}'.format(p)] for p in range(g.attrs['nb_params'])]

# Check if your version of keras version '2.0.0' or above.
# Check if your version of keras is version '2.0.0' or above.
if StrictVersion(keras_version) >= StrictVersion('2.0.0'):
# If your version of keras version '2.0.0' or above,
# If your version of keras is version '2.0.0' or above,
# then
# 1. convert each element x of the list 'weights'
# into a numpy array,
Expand Down

0 comments on commit d38d662

Please sign in to comment.