Some questions for LSTM

I am trying to do batch training using LSTM for a time series data with multiple features.
Assuming I have 5000 samples and 5 features for each sample. The input uses 14 days into the past and the output is a single value on the 15th day. (My time step is 14). The size of my data is the following:

using Flux
using Flux: Flux.Data.DataLoader
X = rand(14,5,5000);
Y = rand(1,1,5000);

model = Chain(
LSTM(5, 20),
Dropout(0.5),
Dense(20, 1,σ)
)

#evaluating prediction for the input sequence
function eval_model(x)
Flux.reset!(model)
inputs = [x[1,t,:] for t in 1:14]
output = model.(inputs)
end

L(x, y) = Flux.mse(eval_model(X), Y)
opt = ADAM(0.001)

#creating batches and training 
train_loader = DataLoader((X, Y), batchsize=30, shuffle=true)
@time Flux.train!(L, params(model), train_loader, opt)

But some errors show as follow:
BoundsError: attempt to access 14×5×5000 Array{Float64,3} at index [1, 6, 1:5000]
Errors happen in train_loader = DataLoader((X, Y), batchsize=30, shuffle=true)
How can I solve it?
Another question: How to show the loss during the training process?

Answering your first question,
Problem seems to be here.
t → varies from 1:14, but at 2nd index of x, you only have 5 elements (x = rand(14,5,5000)).

So it should be inputs = [x[t,:,:] for t in 1:14] or inputs = [x[:,:,t] for t in 1:14],according to the problem aboved?

I try to turn inputs = [x[1,t,:] for t in 1:14] as inputs = [x[t,:,:] for t in 1:14], it also show me
MethodError: no method matching (::Flux.LSTMCell{Array{Float32,2},Array{Float32,1},Tuple{Array{Float32,2},Array{Float32,2}}})(::Tuple{Array{Float32,2},Array{Float32,2}}, ::Array{Float64,2})
Closest candidates are:
Any(::Any, ::Union{AbstractArray{T,2}, AbstractArray{T,1}, Flux.OneHotArray}) where {A, V, T} at C:\Users\zlq.julia\packages\Flux\qp1gc\src\layers\recurrent.jl:137
The same error happened when change asinputs = [x[:,:,t] for t in 1:14]

Sorry, I haven’t used LSTM / RNN from Flux yet, so i don’t have an answer,
But there is kind of similar post where you might get some lead →

Sorry, I still do not understand how the method solves my error.

Can anyone solve the error I proposed at first? Thank you very much