sherjilozair / char-rnn-tensorflow

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
MIT License
2.64k stars 957 forks source link

create_batches() from utils.py throws error #11

Open ghost opened 8 years ago

ghost commented 8 years ago

root@ip-172-31-23-174:/home/ubuntu/char-rnn# python train.py I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally loading preprocessed files Traceback (most recent call last): File "train.py", line 75, in main() File "train.py", line 39, in main train(args) File "train.py", line 42, in train data_loader = TextLoader(args.data_dir, args.batch_size, args.seq_length) File "/home/ubuntu/char-rnn/utils.py", line 22, in init self.create_batches() File "/home/ubuntu/char-rnn/utils.py", line 52, in create_batches ydata[-1] = xdata[0] IndexError: index 0 is out of bounds for axis 0 with size 0

pajowu commented 8 years ago

This happend when self.tensor.size is less than (self.batch_size * self.seq_length). You can avoid that by either reducing sec_lenght or batch_size or increasing the amount of input data.

hunkim commented 8 years ago

I put pr #25. Let me know this can solve your issue.

hugovk commented 7 years ago

@thecerial PR #25 is merged, can this be closed?

hunkim commented 7 years ago

Sure.

On Fri, Jan 13, 2017 at 7:30 AM, Hugo notifications@github.com wrote:

@thecerial https://github.com/thecerial PR #25 https://github.com/sherjilozair/char-rnn-tensorflow/pull/25 is merged, can this be closed?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sherjilozair/char-rnn-tensorflow/issues/11#issuecomment-272371485, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3DV8hgw5kcHjC9TaEawVjKumRDqYowks5rRxn1gaJpZM4Hg-cd .