Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

TypeError: Expected binary or unicode string, got None #28

Closed
hscspring opened this issue Jul 24, 2017 · 2 comments
Closed

TypeError: Expected binary or unicode string, got None #28

hscspring opened this issue Jul 24, 2017 · 2 comments

Comments

@hscspring
Copy link

My python version is 3.6.1, and tf version is 1.2.1.
I've gotten an error when I ran inference:

cat > /tmp/my_infer_file.vi
# (copy and paste some sentences from /tmp/nmt_data/tst2013.vi)

python -m nmt.nmt \
    --model_dir=/tmp/nmt_model \
    --inference_input_file=/tmp/my_infer_file.vi \
    --inference_output_file=/tmp/nmt_model/output_infer

cat /tmp/nmt_model/output_infer # To view the inference as output

The error message is here:

Traceback (most recent call last):
  File "/home_path/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home_path/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home_path/Documents/char-rnn/nmt-master/nmt/nmt.py", line 478, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/home/openmind/.pyenv/versions/3.6.1/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home_path/Documents/char-rnn/nmt-master/nmt/nmt.py", line 438, in main
    if not tf.gfile.Exists(out_dir): tf.gfile.MakeDirs(out_dir)
  File "/home_path/.pyenv/versions/3.6.1/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 252, in file_exists
    pywrap_tensorflow.FileExists(compat.as_bytes(filename), status)
  File "/home_path/.pyenv/versions/3.6.1/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 65, in as_bytes
    (bytes_or_text,))
TypeError: Expected binary or unicode string, got None

Is there anyone who have faced the same issue?

@oahziur
Copy link
Contributor

oahziur commented Jul 24, 2017

@hscspring This should be fixed by 75aa22d.

The command was out of date, the correct command is:

python -m nmt.nmt \
    --out_dir=/tmp/nmt_model \
    --inference_input_file=/tmp/my_infer_file.vi \
    --inference_output_file=/tmp/nmt_model/output_infer

@oahziur oahziur closed this as completed Jul 24, 2017
@hscspring
Copy link
Author

@oahziur Oh, I missed it, Thanks a lot~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants