From 77eff437afeee7ffc8f952f065d04bdfda277e06 Mon Sep 17 00:00:00 2001 From: JiabinYang Date: Thu, 16 Aug 2018 12:21:13 +0000 Subject: [PATCH] fix print() function to fit python3 --- 04.word2vec/train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04.word2vec/train.py b/04.word2vec/train.py index d0fb1b9..420d7e8 100644 --- a/04.word2vec/train.py +++ b/04.word2vec/train.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +from __future__ import print_function import paddle.v2 as paddle import paddle.fluid as fluid import numpy @@ -104,7 +104,7 @@ def train(use_cuda, train_program, params_dirname): avg_cost = outs[0] if event.step % 10 == 0: - print "Step %d: Average Cost %f" % (event.step, avg_cost) + print("Step %d: Average Cost %f" % (event.step, avg_cost)) # If average cost is lower than 5.8, we consider the model good enough to stop. # Note 5.8 is a relatively high value. In order to get a better model, one should -- GitLab