Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function LSTM() not working #1

Open
FrancoisFEM opened this issue Feb 22, 2024 · 0 comments
Open

function LSTM() not working #1

FrancoisFEM opened this issue Feb 22, 2024 · 0 comments

Comments

@FrancoisFEM
Copy link

Hello,
I attempted to use the LSTM function with Julia 1.9.4 by following all installation steps. A test like pyimport("torch").nn.L1Loss() returns a pointer, which seems to be the expected behavior.
So, I tried running the following code:
Random.seed!(123) # For reproducibility electricity_demand = rand(100:500, 365) date = Date(2024, 1, 1):Date(2024, 12, 30) df = DataFrame(Date=date, Electricity_Demand=electricity_demand) model = LSTM(data=df, target_variable="Electricity_Demand", n_timesteps=12) # default parameters with 12 timestep history
I get the following error :
`
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/FrancoisR/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'IndexError'>
IndexError('list index out of range')
File "/home/xxx/.local/lib/python3.9/site-packages/nowcast_lstm/LSTM.py", line 88, in init
self.dataset = self.data_setup.gen_dataset(
File "/home/xxx/.local/lib/python3.9/site-packages/nowcast_lstm/data_setup.py", line 236, in gen_dataset
if arma_models[0] is None:

Stacktrace:
[1] pyerr_check
@ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:75 [inlined]
[2] pyerr_check
@ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:79 [inlined]
[3] _handle_error(msg::String)
@ PyCall ~/.julia/packages/PyCall/1gn3u/src/exception.jl:96
[4] macro expansion
@ ~/.julia/packages/PyCall/1gn3u/src/exception.jl:110 [inlined]
[5] #107
@ ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 [inlined]
[6] disable_sigint
@ ./c.jl:473 [inlined]
[7] __pycall!
@ ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:42 [inlined]
[8] _pycall!(ret::PyObject, o::PyObject, args::Tuple{}, nargs::Int64, kw::PyObject)
@ PyCall ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:29
[9] pycall!(ret::PyObject, o::PyObject, args::Tuple{}, kwargs::Base.Pairs{Symbol, Any, NTuple{15, Symbol}, NamedTuple{(:data, :target_variable, :n_timesteps, :fill_na_func, :fill_ragged_edges_func, :n_models, :train_episodes, :batch_size, :decay, :n_hidden, :n_layers, :dropout, :criterion, :optimizer, :optimizer_parameters), Tuple{PyObject, String, Int64, PyObject, PyObject, Int64, Int64, Int64, Float64, Int64, Int64, Float64, PyObject, PyObject, Dict{String, Float64}}}})
@ PyCall ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:11
[10] #
#114
@ ~/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:86 [inlined]
[11] LSTM(; data::DataFrame, target_variable::String, n_timesteps::Int64, fill_na_func::PyObject, fill_ragged_edges_func::PyObject, n_models::Int64, train_episodes::Int64, batch_size::Int64, decay::Float64, n_hidden::Int64, n_layers::Int64, dropout::Float64, criterion::PyObject, optimizer::PyObject, optimizer_parameters::Dict{String, Float64})
@ NowcastLSTM ~/.julia/packages/NowcastLSTM/e8VJh/src/Functions.jl:86
[12] top-level scope
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant