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

MWE for the crash #17

Open
drozzy opened this issue Dec 16, 2020 · 4 comments
Open

MWE for the crash #17

drozzy opened this issue Dec 16, 2020 · 4 comments

Comments

@drozzy
Copy link

drozzy commented Dec 16, 2020

Ok, finally figured out what cases #14 to crash:

using DataLoaders

features = rand(2)
dataloader = DataLoader((features, features), 100, useprimary = true)

for (xs, ys) in dataloader
    print(size(xs))
    print(size(ys))
    break
end

You will see it crashes during the loop, and then hangs inside of it.

@drozzy
Copy link
Author

drozzy commented Dec 16, 2020

Base.StackTraces.StackFrame[(::DataLoaders.var"#inloop#10"{DataLoaders.WorkerPool{Int64}})(::Int64) at workerpool.jl:55, macro expansion at workerpool.jl:65 [inlined], #6 at macros.jl:19 [inlined], #63 at qpool.jl:195 [inlined], (::ThreadPools.var"#59#60"{ThreadPools.var"#63#65"{DataLoaders.var"#6#12"{DataLoaders.var"#inloop#10"{DataLoaders.WorkerPool{Int64}}}},Tuple{Int64,Int64}})() at qpool.jl:86]
┌ Error: Exception while executing task on worker 4. Shutting down WorkerPool.
│   e =
│    MethodError: no method matching copyrec!(::SubArray{Float64,0,Array{Float64,1},Tuple{Int64},true}, ::Float64)
│    Closest candidates are:
│      copyrec!(::AbstractArray, ::AbstractArray) at /home/andriy/.julia/packages/DataLoaders/uGlPg/src/batchview.jl:112
│   stacktrace = 6-element Array{Base.StackTraces.StackFrame,1}: …
│   args = 1
└ @ DataLoaders ~/.julia/packages/DataLoaders/uGlPg/src/workerpool.jl:56

@drozzy
Copy link
Author

drozzy commented Dec 16, 2020

I mean I solved it by reshaping the input to be (1, n).

But I think the error could be more helpful and the hanging makes it necessary to kill Julia process.

@darsnack
Copy link

Okay seems like this bug is an MLDataPattern.jl issue. Iterating a row vector gives arrays, but iterating a column vector gives scalars. We should specialize getobs on AbstractVectors separately from AbstractArrays (right now they hit the same method).

@lorenzoh
Copy link
Owner

@darsnack Should we open an issue in MLDataPattern.jl then?

@drozzy Unfortunately I haven't been able to reliably send worker exceptions to the main thread so it is interrupted. This line is supposed to do just do that, but doesn't do so reliably.

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

3 participants