From ee4e218810a48276b58cf298ef9803e10aaf003c Mon Sep 17 00:00:00 2001 From: JiabinYang Date: Thu, 16 Aug 2018 12:05:01 +0000 Subject: [PATCH] fix representation problem in train.py --- 03.image_classification/train.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/03.image_classification/train.py b/03.image_classification/train.py index 10ce9df..b323ebc 100644 --- a/03.image_classification/train.py +++ b/03.image_classification/train.py @@ -116,9 +116,12 @@ def infer(use_cuda, inference_program, params_dirname=None): img = load_image(cur_dir + '/image/dog.png') # inference - results = inferencer.infer({'pixel': img}) - print("infer results: ", results) + label_list = [ + "airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", + "ship", "truck" + ] + print("infer results: %s" % label_list[np.argmax(results[0])]) def main(use_cuda): -- GitLab