-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Error when using Float64: ERROR: UndefRefError: access to undefined reference #490
Comments
Perhaps needs a loosening of the signature in NNlib |
I've been experiencing a similar problem as raised here by @contradict ( |
although the error here is weird and should be fixed, I'm not sure we want to support mixed Float32/Float64 computations, we should at least throw a warning. For example, all layers in the |
That sounds reasonable @CarloLucibello. I've spent a couple days trying to identify the root of the error to create a fix but have not been successful yet. Even when running the accepted solution in the linked discussion, I still encounter typing issues while trying to backprop the pooling layer. |
I have run into this problem in a different way.
and conv_direct.jl:98, 141
The problem arises when My quick workaround is changing the behavior of
(I am not an expert in Julia, so I am not sure which behavior should change.) |
That seems reasonable but |
I think it is not about f32/64 specifically, but some internal type handling during the |
FWIW the original MWE works without issue for me on Flux 0.12.7 and Zygote 0.6.23. We'll need a new one to keep investigating this. |
@zomborid NNlib.jl/src/impl/conv_direct.jl Lines 37 to 40 in c30ea9b
|
For my case I finally decided on the workaround of defining
Although I think that reading a possibly undefined value is a bug in Flux. |
Wait, are you defining a completely custom numeric type? Certainly I'm surprised that it works at all then, though it is a fair argument that the optimized for simplicity direct conv implementation should be able unknown numeric types as long as they adhere to some interface. |
The original MWE in the OP works for me on 1.7-rc1. Since the extended issue seems to arise from
If Flux requires this to be zeroed, I'd suggest using either |
The MWE runs fine on Julia 1.8.5 with Flux 0.13.15. |
So the fix is basically what @Seelengrab mentioned: add a loop at the start of the direct conv functions which zeros out the destination array. The original routine was written cleverly, but without regard for more exotic numeric types. Because the functions in question are fallback methods I would not consider this super high priority, but happy to guide someone through a PR if there's interest. |
@gdalle and I ran into this issue with SparseConnectivityTracer.jl's tracer types.
I think I'll take you up on that. Is it enough to add the following line? fill!(y, zero(yT)) |
Distilled from this discussion. I couldn't remove anything further and still reproduce the crash.
Julia 1.4.1, Flux 0.10.4
The text was updated successfully, but these errors were encountered: