-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
InstanceNorm throws a scalar getindex disallowed error on GPU #1195
Comments
andevellicus
changed the title
InstanceNorm throws a getindex error on GPU
InstanceNorm throws a scalar getindex disallowed error on GPU
May 28, 2020
bump julia> l = gpu(InstanceNorm(8));
julia> X = CUDA.randn(Float32, 32, 32, 8, 2);
julia> Flux.mse(X, l(X))
2.5004668f-11
julia> gradient(()->Flux.mse(X, l(X)), Flux.params(l))
ERROR: scalar getindex is disallowed
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] assertscalar(::String) at /home/jc/local/.julia/packages/GPUArrays/uaFZh/src/host/indexing.jl:41
[3] getindex at /home/jc/local/.julia/packages/GPUArrays/uaFZh/src/host/indexing.jl:96 [inlined]
[4] getindex at /home/jc/local/.julia/packages/GPUArrays/uaFZh/src/host/indexing.jl:117 [inlined]
[5] _broadcast_getindex at ./broadcast.jl:614 [inlined]
[6] _getindex at ./broadcast.jl:645 [inlined]
[7] _broadcast_getindex at ./broadcast.jl:620 [inlined]
[8] getindex at ./broadcast.jl:575 [inlined]
[9] copy at ./broadcast.jl:876 [inlined]
[10] materialize(::Base.Broadcast.Broadcasted{CUDA.CuArrayStyle{2},Nothing,Zygote.var"#1159#1162"{CUDA.var"#861#862"{Float32}},Tuple{CuArray{Float32,2}}}) at ./broadcast.jl:837
[11] broadcast_forward(::Function, ::CuArray{Float32,2}) at /home/jc/local/.julia/packages/Zygote/C94Hq/src/lib/broadcast.jl:181
[12] adjoint at /home/jc/local/.julia/packages/Zygote/C94Hq/src/lib/broadcast.jl:193 [inlined]
[13] _pullback at /home/jc/local/.julia/packages/ZygoteRules/6nssF/src/adjoint.jl:47 [inlined]
[14] adjoint at /home/jc/local/.julia/packages/Zygote/C94Hq/src/lib/lib.jl:179 [inlined]
[15] _pullback at /home/jc/local/.julia/packages/ZygoteRules/6nssF/src/adjoint.jl:47 [inlined]
[16] broadcasted at ./broadcast.jl:1257 [inlined]
[17] InstanceNorm at /home/jc/Documents/Julia/Flux.jl/src/layers/normalise.jl:313 [inlined]
[18] _pullback(::Zygote.Context, ::InstanceNorm{typeof(identity),CuArray{Float32,1},CuArray{Float32,1},Float32}, ::CuArray{Float32,4}) at /home/jc/local/.julia/packages/Zygote/C94Hq/src/compiler/interface2.jl:0
[19] #3 at ./REPL[11]:1 [inlined]
[20] _pullback(::Zygote.Context, ::var"#3#4") at /home/jc/local/.julia/packages/Zygote/C94Hq/src/compiler/interface2.jl:0
[21] pullback(::Function, ::Zygote.Params) at /home/jc/local/.julia/packages/Zygote/C94Hq/src/compiler/interface.jl:172
[22] gradient(::Function, ::Zygote.Params) at /home/jc/local/.julia/packages/Zygote/C94Hq/src/compiler/interface.jl:53
[23] top-level scope at REPL[11]:1
(v1.5) pkg> st
Status `/mnt/local/home/jc/.julia/environments/v1.5/Project.toml`
[c7e460c6] ArgParse v1.1.1
[6e4b80f9] BenchmarkTools v0.5.0
[052768ef] CUDA v2.3.0
[5ae59095] Colors v0.12.4
[863f3e99] Comonicon v0.10.1
[31a5f54b] Debugger v0.6.6
[b4f34e82] Distances v0.9.2
[53c48c17] FixedPointNumbers v0.8.4
[587475ba] Flux v0.11.2
[5fb14364] OhMyREPL v0.5.10
[91a5bcdd] Plots v1.9.1
[295af30f] Revise v3.1.9
[5e47fb64] TestImages v1.3.1
|
Is that captured in the cuda tests appropriately |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using InstanceNorm on a 3D CNN, on the GPU with
I get the following stack trace (abbreviated)
BatchNorm works without a problem.
Flux 0.10.4
Julia 1.4.2
CuArrays 2.2.0
The text was updated successfully, but these errors were encountered: