diff --git a/python/paddle/dataset/wmt16.py b/python/paddle/dataset/wmt16.py index 39c6e78b9b431d0747118977eca3e9b476488344..4a0c1f8cb663ec105030ac2c5a70c5f906cf6d12 100644 --- a/python/paddle/dataset/wmt16.py +++ b/python/paddle/dataset/wmt16.py @@ -78,7 +78,7 @@ def __build_dict(tar_file, dict_size, save_path, lang): six.iteritems(word_dict), key=lambda x: x[1], reverse=True)): if idx + 3 == dict_size: break - fout.write("%s\n" % (cpt.to_text(word[0]))) + fout.write("%s\n" % (cpt.to_bytes(word[0]))) def __load_dict(tar_file, dict_size, lang, reverse=False):