Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open #32

Open
lastkoh opened this issue Nov 30, 2017 · 1 comment

Comments

@lastkoh
Copy link

lastkoh commented Nov 30, 2017

I bump into the issue while trying to train based on the data from twitter_en-big

python main.py --mode train --model_name twitter_en_big

My working environment is:
Windows 10 64 bit
Python 3.5
tensorflow-gpu v1.0.0

One more thing that I need to confirm is my file naming correct for the train and test data?

D:\Dev-Projects\tf_chatbot_seq2seq_antilm\works\twitter_en_big\data\train\chat.test.gz
D:\Dev-Projects\tf_chatbot_seq2seq_antilm\works\twitter_en_big\data\test\chat_test.txt

Created model with fresh parameters.
Reading development and training data (limit: 0).
Traceback (most recent call last):
  File "main.py", line 28, in <module>
    tf.app.run()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 18, in main
    train(args)
  File "D:\Dev-Projects\tf_chatbot_seq2seq_antilm\lib\train.py", line 48, in train
    dev_set = data_utils.read_data(dev_data, args.buckets, reversed=args.rev_model)
  File "D:\Dev-Projects\tf_chatbot_seq2seq_antilm\lib\data_utils.py", line 399, in read_data
    source, target = fh.readline(), fh.readline()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 123, in readline
    self._preread_check()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 73, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\contextlib.py", line 66, in __exit__
    next(self.gen)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\site-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: NewRandomAccessFile failed to Create/Open: works/twitter_en_big/data\chat_test.ids100000.in : The system cannot find the file specified.

Thank you.

@ssapra1
Copy link

ssapra1 commented Mar 27, 2018

Change in the train.py , as given below as

if not os.path.exists("%s/chat.in" % data_dir):
n = 0
f_zip = gzip.open("%s/train/chat.txt.gz" % data_dir,'rb')
f_train = open("%s/chat.in" % data_dir, 'wb')
f_dev = open("%s/chat_test.in" % data_dir, 'wb')

rb == Read bytes
wb==write bytes

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

No branches or pull requests

2 participants