Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#595 from JiabinYang/book04_refine
Browse files Browse the repository at this point in the history
fix print() function to fit python3
  • Loading branch information
chenwhql authored Aug 17, 2018
2 parents 432638d + 77eff43 commit d50c2e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 04.word2vec/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -104,7 +104,7 @@ def event_handler(event):
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
Expand Down

0 comments on commit d50c2e1

Please sign in to comment.