karpathy / char-rnn

Multi-layer Recurrent Neural Networks (LSTM, GRU, RNN) for character-level language models in Torch
11.59k stars 2.58k forks source link

Fixed generic error message when input.txt can't be found #125

Closed skwerlman closed 8 years ago

skwerlman commented 8 years ago

I simply added an assert around the io.open which grabs input.txt. Now, instead of:

./util/CharSplitLMMinibatchLoader.lua:139: attempt to index global 'f' (a nil value)

the user sees something similar to:

./util/CharSplitLMMinibatchLoader.lua:133: data/tinyshakespeare/input.txt: No such file or directory

I also fixed f being global.

karpathy commented 8 years ago

Looks great, thank you!