Reputation: 53
I got the files reader.py and ptb_word_lm.py from google and tried running them as python ptb_word_lm.py --data_path=/tmp/simple-examples/data/ --model small
. Please help me in resolving these errors.
Errors:
Traceback (most recent call last):
File "ptb_word_lm.py", line 321, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "ptb_word_lm.py", line 268, in main
raw_data = reader.ptb_raw_data(FLAGS.data_path)
File "/home/ymakkapa/TensorFlow/reader.py", line 51, in ptb_raw_data
word_to_id = _build_vocab(train_path)
File "/home/ymakkapa/TensorFlow/reader.py", line 17, in _build_vocab
data = _read_words(filename)
File "/home/ymakkapa/TensorFlow/reader.py", line 13, in _read_words
return f.read().decode("utf-8").replace("\n", "<eos>").split()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 106, in read
self._preread_check()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 73, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: /tmp/simple-examples/data/ptb.train.txt
Upvotes: 1
Views: 377
Reputation: 13
Using the complete path should solve your problem. Use
python models/tutorials/rnn/ptb/ptb_word_lm.py --data_path=simple-examples/data/ --model=small
Upvotes: 0
Reputation: 405
First, you must download and extract the data in the same directory with you python code
$ wget http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz
$ tar xvf simple-examples.tgz
Then, you must specify the data directory path for the code to work. You can read the documentation that give sample command to run the program
$ python ptb_word_lm.py --data_path=simple-examples/data/
Upvotes: 1