THUNLP-MT / THUMT

An open-source neural machine translation toolkit developed by Tsinghua Natural Language Processing Group
BSD 3-Clause "New" or "Revised" License
701 stars 197 forks source link

checkpoint averaging error. #74

Closed Felixgithub2017 closed 4 years ago

Felixgithub2017 commented 5 years ago

When running the checkpoint averaging script, I got the following error. I am using python 3, I think it is the problem.

Traceback (most recent call last): File "thumt/scripts/checkpoint_averaging.py", line 121, in tf.app.run() File "/home/felix/miniconda3/envs/py37-trans/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "thumt/scripts/checkpoint_averaging.py", line 103, in main var_values.iteritems()): AttributeError: 'dict' object has no attribute 'iteritems'

Playinf commented 5 years ago

There are 2 solutions:

  1. Using Python2 instead of Python3
  2. Import the six package, replace *.iteritems() with six.iteritems(*)