Skip to content

Commit

Permalink
Explicitly use the Theano image ordering (in case of using the Tensor…
Browse files Browse the repository at this point in the history
…Flow backend).
  • Loading branch information
clungu committed May 29, 2017
1 parent 84b917d commit 9f2fca9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deeplearning1/nbs/vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
from keras.optimizers import SGD, RMSprop, Adam
from keras.preprocessing import image

# In case we are going to use the TensorFlow backend we need to explicitly set the Theano image ordering
from keras import backend as K
K.set_image_dim_ordering('th')


vgg_mean = np.array([123.68, 116.779, 103.939], dtype=np.float32).reshape((3,1,1))
def vgg_preprocess(x):
Expand Down
3 changes: 3 additions & 0 deletions deeplearning1/nbs/vgg16bn.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from keras.optimizers import SGD, Adam
from keras.preprocessing import image

# In case we are going to use the TensorFlow backend we need to explicitly set the Theano image ordering
from keras import backend as K
K.set_image_dim_ordering('th')

vgg_mean = np.array([123.68, 116.779, 103.939], dtype=np.float32).reshape((3,1,1))
def vgg_preprocess(x):
Expand Down

0 comments on commit 9f2fca9

Please sign in to comment.