From b3bd432876e8a5cf7d1d62a1c8266dfd6384a067 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Mon, 16 Jan 2017 13:50:32 +0900 Subject: [PATCH] add compatibility for Python 3 --- squeezenet.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/squeezenet.py b/squeezenet.py index 54f1dad..23d19a0 100644 --- a/squeezenet.py +++ b/squeezenet.py @@ -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 @@ -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)