Solved by ptrblck in post #2 
              
              
                It seems the data provided by the DataLoader does not contain enough values to be reshaped to [10, 30, 1]. Could you check the shape of train_x_np? 
However, if the error occurs later in the training and the first iterations are running successful, the last batch might be smaller, thus yielding this…