Skip to content

Commit

Permalink
Merge pull request #3 from uetchy/python3
Browse files Browse the repository at this point in the history
Add compatibility for Python 3 by @uetchy
  • Loading branch information
rcmalli committed Feb 13, 2017
2 parents 0166695 + b3bd432 commit 5fd5fce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions squeezenet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
from keras.layers import Input, merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dropout, Activation
Expand Down Expand Up @@ -76,16 +77,16 @@ def get_squeezenet(nb_classes, dim_ordering='tf'):
model = get_squeezenet(1000)

duration = time.time() - start
print "{} s to make model".format(duration)
print("{} s to make model".format(duration))

start = time.time()
model.output
duration = time.time() - start
print "{} s to get output".format(duration)
print("{} s to get output".format(duration))

start = time.time()
model.compile(loss="categorical_crossentropy", optimizer="adam")
duration = time.time() - start
print "{} s to get compile".format(duration)
print("{} s to get compile".format(duration))

plot(model, to_file='images/SqueezeNet.png', show_shapes=True)

0 comments on commit 5fd5fce

Please sign in to comment.