Solved by jpeg729 in post #7 
              
              
                My mistake, you also have to set the correct new batch size. 
model.batch_size = test_batch_size
model.hidden_state = model.init_hidden()

If you don’t know why you need to do that then you know little about how an LSTM works. 

Wrong. Using a batch size of 512 simply means that you feed the model w…