From a4979d2025df2eec1657ea062ad7c7cd2634ccd9 Mon Sep 17 00:00:00 2001 From: JiabinYang Date: Fri, 13 Jul 2018 20:49:48 +0000 Subject: [PATCH] refine comments and the presentation of inference result for book03 --- 01.fit_a_line/fit_a_line.inference.model/fc_0.b_0 | Bin 0 -> 28 bytes 01.fit_a_line/fit_a_line.inference.model/fc_0.w_0 | Bin 0 -> 78 bytes .../fit_a_line.inference.model/learning_rate_0 | Bin 0 -> 28 bytes .../fit_a_line.inference.model/mean_0.tmp_0@GRAD | Bin 0 -> 28 bytes 03.image_classification/README.cn.md | 7 ++++--- 03.image_classification/index.cn.html | 7 ++++--- 6 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 01.fit_a_line/fit_a_line.inference.model/fc_0.b_0 create mode 100644 01.fit_a_line/fit_a_line.inference.model/fc_0.w_0 create mode 100644 01.fit_a_line/fit_a_line.inference.model/learning_rate_0 create mode 100644 01.fit_a_line/fit_a_line.inference.model/mean_0.tmp_0@GRAD diff --git a/01.fit_a_line/fit_a_line.inference.model/fc_0.b_0 b/01.fit_a_line/fit_a_line.inference.model/fc_0.b_0 new file mode 100644 index 0000000000000000000000000000000000000000..9d43abadd98a5ddc54538b94298ce9331d2cb135 GIT binary patch literal 28 VcmZQzKm{y7E(fasqqx)-djJDv0Y?A; literal 0 HcmV?d00001 diff --git a/01.fit_a_line/fit_a_line.inference.model/fc_0.w_0 b/01.fit_a_line/fit_a_line.inference.model/fc_0.w_0 new file mode 100644 index 0000000000000000000000000000000000000000..a881eb580f0c6bafd7505ca704a1d7f8e5e24883 GIT binary patch literal 78 zcmZQzKm}|-E(fasuK?qMgY9-3qht0(NzUCTwn%s1-OO+MZeH7EH=)UCzq#s{ef(#S X+jTBlywA$_?Y=yP2HTfQr|$&-^DZ2X literal 0 HcmV?d00001 diff --git a/01.fit_a_line/fit_a_line.inference.model/learning_rate_0 b/01.fit_a_line/fit_a_line.inference.model/learning_rate_0 new file mode 100644 index 0000000000000000000000000000000000000000..66bdf9c01ed988dbabbcdb5d80c7c2b33e3269ac GIT binary patch literal 28 VcmZQzKm{y7E(fasW4=(c6#xWA0bu|D literal 0 HcmV?d00001 diff --git a/01.fit_a_line/fit_a_line.inference.model/mean_0.tmp_0@GRAD b/01.fit_a_line/fit_a_line.inference.model/mean_0.tmp_0@GRAD new file mode 100644 index 0000000000000000000000000000000000000000..0b26358c07d8cb50206b90e46ed2267c0250d19f GIT binary patch literal 28 VcmZQzKm{y7E(fasBLhQ&Jpckz0O9}u literal 0 HcmV?d00001 diff --git a/03.image_classification/README.cn.md b/03.image_classification/README.cn.md index 59180d1..3f21327 100644 --- a/03.image_classification/README.cn.md +++ b/03.image_classification/README.cn.md @@ -160,6 +160,7 @@ import paddle import paddle.fluid as fluid import numpy import sys +from __future__ import print_function ``` 本教程中我们提供了VGG和ResNet两个模型的配置。 @@ -426,7 +427,7 @@ def event_handler(event): 通过`trainer.train`函数训练: -**注意:** CPU,每个 Epoch 将花费大约15~20分钟。这部分可能需要一段时间。请随意修改代码,在GPU上运行测试,以提高培训速度。 +**注意:** CPU,每个 Epoch 将花费大约15~20分钟。这部分可能需要一段时间。请随意修改代码,在GPU上运行测试,以提高训练速度。 ```python trainer.train( @@ -499,10 +500,10 @@ img = load_image(cur_dir + '/image/dog.png') ```python inferencer = fluid.Inferencer( infer_func=inference_program, param_path=params_dirname, place=place) - +label_list = ["airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", "ship", "truck"] # inference results = inferencer.infer({'pixel': img}) -print("infer results: ", results) +print("infer results: %s" % label_list[np.argmax(results[0])]) ``` ## 总结 diff --git a/03.image_classification/index.cn.html b/03.image_classification/index.cn.html index dbd1f1c..0aa3cf2 100644 --- a/03.image_classification/index.cn.html +++ b/03.image_classification/index.cn.html @@ -202,6 +202,7 @@ import paddle import paddle.fluid as fluid import numpy import sys +from __future__ import print_function ``` 本教程中我们提供了VGG和ResNet两个模型的配置。 @@ -468,7 +469,7 @@ def event_handler(event): 通过`trainer.train`函数训练: -**注意:** CPU,每个 Epoch 将花费大约15~20分钟。这部分可能需要一段时间。请随意修改代码,在GPU上运行测试,以提高培训速度。 +**注意:** CPU,每个 Epoch 将花费大约15~20分钟。这部分可能需要一段时间。请随意修改代码,在GPU上运行测试,以提高训练速度。 ```python trainer.train( @@ -541,10 +542,10 @@ img = load_image(cur_dir + '/image/dog.png') ```python inferencer = fluid.Inferencer( infer_func=inference_program, param_path=params_dirname, place=place) - +label_list = ["airplane", "automobile", "bird", "cat", "deer", "dog", "frog", "horse", "ship", "truck"] # inference results = inferencer.infer({'pixel': img}) -print("infer results: ", results) +print("infer results: %s" % label_list[np.argmax(results[0])]) ``` ## 总结 -- GitLab