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

Indices not defined #368

Closed
ggordonhall opened this issue Aug 22, 2018 · 0 comments
Closed

Indices not defined #368

ggordonhall opened this issue Aug 22, 2018 · 0 comments

Comments

@ggordonhall
Copy link

ggordonhall commented Aug 22, 2018

When I run batch(xs) with Julia 1.0 I receive this error:

Stacktrace:
[1] batchindex(::Array{Int64,2}, ::Int64) at /Users/ggordon-hall/.julia/packages/Flux/npL2p/src/utils.jl:27
 [2] batch(::Array{Array{Int64,1},1}) at /Users/ggordon-hall/.julia/packages/Flux/npL2p/src/utils.jl:71
 [3] (::getfield(Flux, Symbol("##4#7")){Array{Array{Any,1},1}})(::Int64) at ./none:0
 [4] iterate at ./generator.jl:47 [inlined]
 [5] collect(::Base.Generator{UnitRange{Int64},getfield(Flux, Symbol("##4#7")){Array{Array{Any,1},1}}}) at ./array.jl:619
 [6] batchseq(::Array{Array{Array{Int64,1},1},1}, ::Int64) at /Users/ggordon-hall/.julia/packages/Flux/npL2p/src/utils.jl:94
 [7] top-level scope at none:0
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] exec_options(::Base.JLOptions) at ./client.jl:229
 [12] _start() at ./client.jl:421

It looks like Base.indices from Julia 0.6 has been renamed Base.axes in 1.0, but when I change the function name in utils.jl I get a different error:

ERROR: LoadError: DimensionMismatch("tried to assign 23-element array to 10×1 destination")
Stacktrace:
 [1] throw_setindex_mismatch(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./indices.jl:144
 [2] macro expansion at ./indices.jl:196 [inlined]
 [3] _unsafe_setindex!(::IndexLinear, ::Array{Int64,2}, ::Array{Int64,1}, ::Base.OneTo{Int64}, ::Int64) at ./multidimensional.jl:636
 [4] _setindex! at ./multidimensional.jl:631 [inlined]
 [5] setindex! at ./abstractarray.jl:998 [inlined]
 [6] batch(::Array{Array{Int64,1},1}) at /Users/ggordon-hall/.julia/packages/Flux/npL2p/src/utils.jl:71
 [7] (::getfield(Flux, Symbol("##4#7")){Array{Array{Any,1},1}})(::Int64) at ./none:0
 [8] iterate at ./generator.jl:47 [inlined]
 [9] collect(::Base.Generator{UnitRange{Int64},getfield(Flux, Symbol("##4#7")){Array{Array{Any,1},1}}}) at ./array.jl:619
 [10] batchseq(::Array{Array{Array{Int64,1},1},1}, ::Int64) at /Users/ggordon-hall/.julia/packages/Flux/npL2p/src/utils.jl:94
 [11] top-level scope at none:0
 [12] include at ./boot.jl:317 [inlined]
 [13] include_relative(::Module, ::String) at ./loading.jl:1038
 [14] include(::Module, ::String) at ./sysimg.jl:29
 [15] exec_options(::Base.JLOptions) at ./client.jl:229
 [16] _start() at ./client.jl:421
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