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

ArrayNode reflectinmodel sometimes results in weird error #16

Closed
racinmat opened this issue Dec 6, 2019 · 3 comments
Closed

ArrayNode reflectinmodel sometimes results in weird error #16

racinmat opened this issue Dec 6, 2019 · 3 comments

Comments

@racinmat
Copy link
Collaborator

racinmat commented Dec 6, 2019

The gradient computation crashes on following code, using following data:
https://ufile.io/8wl0eit1

using JLD2, FileIO, Flux, Mill
@load "weird_node.jld2" x1 y
model = reflectinmodel(x1, d -> Chain(Dense(d, settings.k, relu),),
	d -> SegmentedMeanMax(d),
	b = Dict("" =>  d -> Chain(Dense(d, 2),)))
ps = Flux.params(model)
loss = (model, x, y) -> Flux.logitcrossentropy(model(x).data,y)
loss(model, x1,y)
Flux.logitcrossentropy(model(x1).data,y)
gradient(() -> loss(model, x1,y), ps)

with error
ERROR: MethodError: no method matching zero(::Type{Any}) Closest candidates are: zero(::Type{Union{Missing, T}}) where T at missing.jl:105 zero(::Type{Missing}) at missing.jl:103 zero(::Type{LibGit2.GitHash}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\LibGit2\src\oid.jl:220

@simonmandlik
Copy link
Collaborator

This is most probably because Flux fails when computing gradient of sparse input when the model contains standard dense matrices. See here FluxML/Flux.jl#965

@racinmat
Copy link
Collaborator Author

This seems to be related also to FluxML/Zygote.jl#810 which is not fixed.

@racinmat
Copy link
Collaborator Author

Seems to be fixed right now, because currently, Flux is not using explicit cast

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

2 participants