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

Error when trying to train. #81

Open
probablyrei opened this issue Jul 23, 2018 · 5 comments
Open

Error when trying to train. #81

probablyrei opened this issue Jul 23, 2018 · 5 comments

Comments

@probablyrei
Copy link

When I open train.py I get a traceback error that says:

Traceback (most recent call last):
File "C:\Users\User\Desktop\word-rnn-tensorflow-master\train.py", line 134, in
main()
File "C:\Users\User\Desktop\word-rnn-tensorflow-master\train.py", line 54, in main
train(args)
File "C:\Users\User\Desktop\word-rnn-tensorflow-master\train.py", line 57, in train
data_loader = TextLoader(args.data_dir, args.batch_size, args.seq_length, args.input_encoding)
File "C:\Users\User\Desktop\word-rnn-tensorflow-master\utils.py", line 23, in init
self.preprocess(input_file, vocab_file, tensor_file, encoding)
File "C:\Users\User\Desktop\word-rnn-tensorflow-master\utils.py", line 65, in preprocess
with codecs.open(input_file, "r", encoding=encoding) as f:
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\codecs.py", line 895, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'data/tinyshakespeare\input.txt'

I don't know why it says "No such file or directory: 'data/tinyshakespeare\input.txt'" because it is definitely there..help?

@Enviy
Copy link

Enviy commented Oct 2, 2018

I received this error at first as well. I had to ensure that I was in the same directory as the 'data' folder.

@probablyrei
Copy link
Author

I received this error at first as well. I had to ensure that I was in the same directory as the 'data' folder.

Can you please elaborate on what you mean by that?

@normanheckscher
Copy link
Collaborator

normanheckscher commented Oct 20, 2018 via email

@Enviy
Copy link

Enviy commented Oct 20, 2018

That's a good point about the backslash. At first I thought it was escaping a space character but there shouldn't be a space there so it's odd.

So earlier I mentioned ensuring you were in the 'data' directory. What I meant is that when I encountered a similar issue, it worked when I navigated to the project directory which had the 'data' directory in it. The script has default args which look for the input file in that directory.

@micooke
Copy link

micooke commented Apr 2, 2019

The problem is the formation of the default value for --data_dir
https://github.com/hunkim/word-rnn-tensorflow/blob/master/train.py#L15

You can change this line locally to default=os.join('data','tinyshakespeare') or pass thus parameter when you can it python train --data_dir data\\tinyshakespeare

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

4 participants