Solved by Antonio_Linares in post #2 
              
              
                It seems that it´s fixed by adding this line in my training code: 
hidden = tuple([each.data for each in hidden])

The resulting training code is now: 
for epoch in range(1, n_epochs):
    hidden = lstm.init_hidden(batch_size)

    #now looping through data
    for batch_i, (features, targets) in en…