Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

find UnicodeEncodeError when run command:DATA_TYPE=reverse ./bin/data/toy.sh #87

Description

@nmaac

$ DATA_TYPE=reverse ./bin/data/toy.sh
Using type=reverse. To change this set DATA_TYPE to 'copy' or 'reverse'
Writing to /home/user/nmt_data/toy_reverse. To change this, set the OUTPUT_DIR environment variable.
Traceback (most recent call last):
File "/home/user/workspace/tsinghua/seq2seq/seq2seq/bin/tools/generate_toy_data.py", line 146, in
main()
File "/home/user/workspace/tsinghua/seq2seq/seq2seq/bin/tools/generate_toy_data.py", line 142, in main
write_parallel_text(train_sources, train_targets, ARGS.output_dir)
File "/home/user/workspace/tsinghua/seq2seq/seq2seq/bin/tools/generate_toy_data.py", line 115, in write_parallel_text
source_file.write(record + "\n")
UnicodeEncodeError: 'ascii' codec can't encode character u'\u7b11' in position 0: ordinal not in range(128)

using:
python 2.7.5
centos 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions