From b74d0d49d97ecbab42ba8b05b170f1ae630670e1 Mon Sep 17 00:00:00 2001
From: kinghuin
Date: Wed, 17 Jul 2019 18:48:33 +0800
Subject: [PATCH 1/5] fix layers number error test=develop
---
03.image_classification/README.md | 2 +-
03.image_classification/index.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/03.image_classification/README.md b/03.image_classification/README.md
index cd3f6442..783c9a66 100644
--- a/03.image_classification/README.md
+++ b/03.image_classification/README.md
@@ -140,7 +140,7 @@ Figure 9 illustrates the ResNet architecture. To the left is the basic building
Figure 9. Residual block
-Figure 10 illustrates ResNets with 50, 101, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.
+Figure 10 illustrates ResNets with 50, 116, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.

diff --git a/03.image_classification/index.html b/03.image_classification/index.html
index 0a34d23e..aeba2a81 100644
--- a/03.image_classification/index.html
+++ b/03.image_classification/index.html
@@ -182,7 +182,7 @@
Figure 9. Residual block
-Figure 10 illustrates ResNets with 50, 101, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.
+Figure 10 illustrates ResNets with 50, 116, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.

From 43281f29b79ea6b29310174871febbb9aa4c30cc Mon Sep 17 00:00:00 2001
From: kinghuin
Date: Wed, 17 Jul 2019 18:52:57 +0800
Subject: [PATCH 2/5] fix layers number error test=develop
---
03.image_classification/README.cn.md | 2 +-
03.image_classification/index.cn.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/03.image_classification/README.cn.md b/03.image_classification/README.cn.md
index 0fb24313..b402589b 100644
--- a/03.image_classification/README.cn.md
+++ b/03.image_classification/README.cn.md
@@ -146,7 +146,7 @@ ResNet(Residual Network) \[[15](#参考文献)\] 是2015年ImageNet图像分类
图9. 残差模块
-图10展示了50、101、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。
+图10展示了50、116、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。

diff --git a/03.image_classification/index.cn.html b/03.image_classification/index.cn.html
index 19f857a3..acd18c5c 100644
--- a/03.image_classification/index.cn.html
+++ b/03.image_classification/index.cn.html
@@ -188,7 +188,7 @@
图9. 残差模块
-图10展示了50、101、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。
+图10展示了50、116、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。

From 702cb6b04aeb53e3461568c95778668e8a45206e Mon Sep 17 00:00:00 2001
From: kinghuin
Date: Wed, 17 Jul 2019 18:56:15 +0800
Subject: [PATCH 3/5] fix path error and add infer_3 url test=develop
---
02.recognize_digits/README.cn.md | 4 ++--
02.recognize_digits/README.md | 4 ++--
02.recognize_digits/index.cn.html | 4 ++--
02.recognize_digits/index.html | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/02.recognize_digits/README.cn.md b/02.recognize_digits/README.cn.md
index a1488b00..0c88a4f6 100644
--- a/02.recognize_digits/README.cn.md
+++ b/02.recognize_digits/README.cn.md
@@ -524,7 +524,7 @@ Test with Epoch 0, avg_cost: 0.053097883707459624, acc: 0.9822850318471338
### 生成预测输入数据
-`infer_3.png` 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
+[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
```python
def load_image(file):
@@ -558,7 +558,7 @@ with fluid.scope_guard(inference_scope):
lab = numpy.argsort(results)
# 打印 infer_3.png 这张图片的预测结果
- img=Image.open('image/infer_3.png')
+ img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
diff --git a/02.recognize_digits/README.md b/02.recognize_digits/README.md
index 7fc23137..1776b1dc 100644
--- a/02.recognize_digits/README.md
+++ b/02.recognize_digits/README.md
@@ -508,7 +508,7 @@ You can use trained model to classify handwriting pictures of digits. The progra
### Generate input data to be inferred
-`infer_3.png` is an example picture of number 3. Transform it into a numpy to match feed data format
+[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) is an example picture of number 3. Transform it into a numpy to match feed data format
```python
@@ -547,7 +547,7 @@ with fluid.scope_guard(inference_scope):
lab = numpy.argsort(results)
# Print prediction result of infer_3.png
- img=Image.open('image/infer_3.png')
+ img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
diff --git a/02.recognize_digits/index.cn.html b/02.recognize_digits/index.cn.html
index 1fb5d5cb..3417fa5b 100644
--- a/02.recognize_digits/index.cn.html
+++ b/02.recognize_digits/index.cn.html
@@ -566,7 +566,7 @@
### 生成预测输入数据
-`infer_3.png` 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
+[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
```python
def load_image(file):
@@ -600,7 +600,7 @@
lab = numpy.argsort(results)
# 打印 infer_3.png 这张图片的预测结果
- img=Image.open('image/infer_3.png')
+ img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
diff --git a/02.recognize_digits/index.html b/02.recognize_digits/index.html
index bf428731..a09d04b0 100644
--- a/02.recognize_digits/index.html
+++ b/02.recognize_digits/index.html
@@ -550,7 +550,7 @@
### Generate input data to be inferred
-`infer_3.png` is an example picture of number 3. Transform it into a numpy to match feed data format
+[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) is an example picture of number 3. Transform it into a numpy to match feed data format
```python
@@ -589,7 +589,7 @@
lab = numpy.argsort(results)
# Print prediction result of infer_3.png
- img=Image.open('image/infer_3.png')
+ img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
From abb963dff0b3cd18f9b6adc31c5f62e9d11a08df Mon Sep 17 00:00:00 2001
From: kinghuin
Date: Wed, 17 Jul 2019 19:01:03 +0800
Subject: [PATCH 4/5] add 09.gan url test=develop
---
09.gan/README.cn.md | 2 +-
09.gan/index.cn.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/09.gan/README.cn.md b/09.gan/README.cn.md
index 01809605..8e278278 100644
--- a/09.gan/README.cn.md
+++ b/09.gan/README.cn.md
@@ -1,6 +1,6 @@
# 生成对抗网络
-本教程源代码目录在book/09.gan,初次使用请您参考Book文档使用说明。
+本教程源代码目录在[book/09.gan](https://github.com/PaddlePaddle/book/tree/develop/09.gan),初次使用请您参考Book文档使用说明。
### 说明: ###
1. 硬件环境要求:
diff --git a/09.gan/index.cn.html b/09.gan/index.cn.html
index 3990a93c..4b75a1c6 100644
--- a/09.gan/index.cn.html
+++ b/09.gan/index.cn.html
@@ -42,7 +42,7 @@
# 生成对抗网络
-本教程源代码目录在book/09.gan,初次使用请您参考Book文档使用说明。
+本教程源代码目录在[book/09.gan](https://github.com/PaddlePaddle/book/tree/develop/09.gan),初次使用请您参考Book文档使用说明。
### 说明: ###
1. 硬件环境要求:
From 026d344f2351c279a0668712925e5b9ec6490ada Mon Sep 17 00:00:00 2001
From: kinghuin
Date: Wed, 17 Jul 2019 19:02:43 +0800
Subject: [PATCH 5/5] support python3 test=develop
---
05.recommender_system/README.cn.md | 22 +++++++++++-----------
05.recommender_system/README.md | 8 ++++----
05.recommender_system/index.cn.html | 22 +++++++++++-----------
05.recommender_system/index.html | 8 ++++----
4 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/05.recommender_system/README.cn.md b/05.recommender_system/README.cn.md
index f3e1b40d..2bbfc3c1 100644
--- a/05.recommender_system/README.cn.md
+++ b/05.recommender_system/README.cn.md
@@ -136,7 +136,7 @@ Paddle在API中提供了自动加载数据的模块。数据模块为 `paddle.da
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -152,7 +152,7 @@ print movie_info.values()[0]
```python
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -163,7 +163,7 @@ print movie_info.values()[0]
```python
user_info = paddle.dataset.movielens.user_info()
-print user_info.values()[0]
+print(list(user_info.values())[0])
```
@@ -216,7 +216,7 @@ train_set_creator = paddle.dataset.movielens.train()
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
-print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
+print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```
User rates Movie with Score [5.0]
@@ -533,13 +533,13 @@ train_loop()
```python
infer_movie_id = 783
infer_movie_name = paddle.dataset.movielens.movie_info()[infer_movie_id].title
-user_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
-gender_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
-age_id = fluid.create_lod_tensor([[np.int64(0)]], [[1]], place)
-job_id = fluid.create_lod_tensor([[np.int64(10)]], [[1]], place)
-movie_id = fluid.create_lod_tensor([[np.int64(783)]], [[1]], place) # Hunchback of Notre Dame
-category_id = fluid.create_lod_tensor([np.array([10, 8, 9], dtype='int64')], [[3]], place) # Animation, Children's, Musical
-movie_title = fluid.create_lod_tensor([np.array([1069, 4140, 2923, 710, 988], dtype='int64')], [[5]],
+user_id = fluid.create_lod_tensor([[1]], [[1]], place)
+gender_id = fluid.create_lod_tensor([[1]], [[1]], place)
+age_id = fluid.create_lod_tensor([[0]], [[1]], place)
+job_id = fluid.create_lod_tensor([[10]], [[1]], place)
+movie_id = fluid.create_lod_tensor([[783]], [[1]], place) # Hunchback of Notre Dame
+category_id = fluid.create_lod_tensor([[10, 8, 9]], [[3]], place) # Animation, Children's, Musical
+movie_title = fluid.create_lod_tensor([[1069, 4140, 2923, 710, 988]], [[5]],
place) # 'hunchback','of','notre','dame','the'
```
diff --git a/05.recommender_system/README.md b/05.recommender_system/README.md
index 01f5c614..cb74fe9b 100644
--- a/05.recommender_system/README.md
+++ b/05.recommender_system/README.md
@@ -122,7 +122,7 @@ Paddle provides modules for automatically loading data in the API. The data modu
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -138,7 +138,7 @@ For example, one of the movie features is:
```python
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -149,7 +149,7 @@ This means that the movie id is 1, and the title is 《Toy Story》, which is di
```python
user_info = paddle.dataset.movielens.user_info()
-print user_info.values()[0]
+print(list(user_info.values())[0])
```
@@ -202,7 +202,7 @@ train_set_creator = paddle.dataset.movielens.train()
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
-print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
+print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```
```python
diff --git a/05.recommender_system/index.cn.html b/05.recommender_system/index.cn.html
index b8dadd38..485693a3 100644
--- a/05.recommender_system/index.cn.html
+++ b/05.recommender_system/index.cn.html
@@ -178,7 +178,7 @@
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -194,7 +194,7 @@
```python
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -205,7 +205,7 @@
```python
user_info = paddle.dataset.movielens.user_info()
-print user_info.values()[0]
+print(list(user_info.values())[0])
```
@@ -258,7 +258,7 @@
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
-print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
+print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```
User rates Movie with Score [5.0]
@@ -575,13 +575,13 @@
```python
infer_movie_id = 783
infer_movie_name = paddle.dataset.movielens.movie_info()[infer_movie_id].title
-user_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
-gender_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
-age_id = fluid.create_lod_tensor([[np.int64(0)]], [[1]], place)
-job_id = fluid.create_lod_tensor([[np.int64(10)]], [[1]], place)
-movie_id = fluid.create_lod_tensor([[np.int64(783)]], [[1]], place) # Hunchback of Notre Dame
-category_id = fluid.create_lod_tensor([np.array([10, 8, 9], dtype='int64')], [[3]], place) # Animation, Children's, Musical
-movie_title = fluid.create_lod_tensor([np.array([1069, 4140, 2923, 710, 988], dtype='int64')], [[5]],
+user_id = fluid.create_lod_tensor([[1]], [[1]], place)
+gender_id = fluid.create_lod_tensor([[1]], [[1]], place)
+age_id = fluid.create_lod_tensor([[0]], [[1]], place)
+job_id = fluid.create_lod_tensor([[10]], [[1]], place)
+movie_id = fluid.create_lod_tensor([[783]], [[1]], place) # Hunchback of Notre Dame
+category_id = fluid.create_lod_tensor([[10, 8, 9]], [[3]], place) # Animation, Children's, Musical
+movie_title = fluid.create_lod_tensor([[1069, 4140, 2923, 710, 988]], [[5]],
place) # 'hunchback','of','notre','dame','the'
```
diff --git a/05.recommender_system/index.html b/05.recommender_system/index.html
index 20665beb..2c7d9552 100644
--- a/05.recommender_system/index.html
+++ b/05.recommender_system/index.html
@@ -164,7 +164,7 @@
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -180,7 +180,7 @@
```python
movie_info = paddle.dataset.movielens.movie_info()
-print movie_info.values()[0]
+print(list(movie_info.values())[0])
```
@@ -191,7 +191,7 @@
```python
user_info = paddle.dataset.movielens.user_info()
-print user_info.values()[0]
+print(list(user_info.values())[0])
```
@@ -244,7 +244,7 @@
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
-print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
+print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```
```python