Skip to content

Commit 6d0e8f0

Browse files
committed
refactor the cifar10 so that it can export pb model file
1 parent 5dd5821 commit 6d0e8f0

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed
3.99 KB
Binary file not shown.

demo/models/cnn_cifar10_config.npy

322 Bytes
Binary file not shown.

demo/models/cnn_cifar10_weights.h5

-803 KB
Binary file not shown.

demo/models/tf/cnn_cifar10.pb

802 KB
Binary file not shown.

keras_image_classifier/library/cifar10_classifier.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ def load_model(self, model_dir_path):
4545

4646
def predict_label(self, filename):
4747
img = Image.open(filename)
48-
img = img.resize((32, 32), Image.ANTIALIAS)
48+
49+
if K.image_data_format() == 'channels_first':
50+
_, img_width, img_height = self.input_shape
51+
else:
52+
img_width, img_height, _ = self.input_shape
53+
54+
img = img.resize((img_width, img_height), Image.ANTIALIAS)
4955

5056
input = np.asarray(img)
5157
input = input.astype('float32') / 255

0 commit comments

Comments
 (0)