diff --git a/04.word2vec/train.py b/04.word2vec/train.py index d0fb1b950c5ef0d170868ae129bf4bb9aee3b8e5..420d7e80d12157a5f717efe53f243483273b67e9 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