From 113312029026287e82a41d22ae867c0439d8371b Mon Sep 17 00:00:00 2001 From: JiabinYang Date: Fri, 14 Sep 2018 14:32:39 +0000 Subject: [PATCH] fix book05 train.py bug --- 05.recommender_system/train.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/05.recommender_system/train.py b/05.recommender_system/train.py index 564abd3..223bab2 100644 --- a/05.recommender_system/train.py +++ b/05.recommender_system/train.py @@ -213,6 +213,9 @@ def infer(use_cuda, inference_program, params_dirname): # two sequences of indexes, of length 3 and 2, respectively. # Correspondingly, lod = [[3, 2]] contains one level of detail info, # indicating that `data` consists of two sequences of length 3 and 2. + infer_movie_id = 783 + infer_movie_name = paddle.dataset.movielens.movie_info()[ + infer_movie_id].title 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) -- GitLab