Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Fix error with parametric types #35

Closed

Conversation

staticfloat
Copy link

Using @jamii's fix from #17, I can confirm that this seems to work for my workload.

@staticfloat
Copy link
Author

I've added a test, but it's difficult to know if it works because the rest of the tests are interfering. ;)

@staticfloat
Copy link
Author

Even with this change, trying to step through methods that make heavy use of parametric types (such as batchnorm invocation) fails very often with things like:

julia> @enter BN_trk(x)
In BatchNorm(x) at /home/staticfloat/.julia/dev/Flux/src/layers/normalise.jl:114
114     size(x, ndims(x)-1) == length(BN.β) ||
115       error("BatchNorm expected $(length(BN.β)) channels, got $(size(x, ndims(x)-1))")
116     γ, β = BN.γ, BN.β

About to run: (ndims)(<suppressed 2594 bytes of output>)
1|debug > n
typeof(f) = typeof(getproperty)
getproperty
Tuple{BatchNorm{typeof(identity),TrackedArray{…,Array{Float32,1}},Array{Float32,1},Float64},QuoteNode}
ERROR: no unique matching method found for the specified argument types
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] which(::Any, ::Any) at ./reflection.jl:1003
 [3] #determine_method_for_expr#23(::Bool, ::Function, ::Expr) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:285
 [4] #determine_method_for_expr at ./none:0 [inlined]
 [5] #enter_call_expr#25(::Bool, ::Function, ::Expr) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:376
 [6] enter_call_expr(::Expr) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:376
 [7] next_line!(::ASTInterpreter2.JuliaStackFrame, ::Array{ASTInterpreter2.JuliaStackFrame,1}) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:248
 [8] execute_command(::DebuggerFramework.DebuggerState, ::ASTInterpreter2.JuliaStackFrame, ::Val{:n}, ::SubString{String}) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/commands.jl:50
 [9] (::getfield(DebuggerFramework, Symbol("##4#8")){REPL.Terminals.TTYTerminal,DebuggerFramework.DebuggerState,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:276
 [10] #invokelatest#1 at ./essentials.jl:754 [inlined]
 [11] invokelatest at ./essentials.jl:753 [inlined]
 [12] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /home/staticfloat/tmp/julia-build/julia-master/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2273
 [13] run_interface at /home/staticfloat/tmp/julia-build/julia-master/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2267 [inlined]
 [14] RunDebugger(::Array{ASTInterpreter2.JuliaStackFrame,1}, ::REPL.LineEditREPL, ::REPL.Terminals.TTYTerminal) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:314
 [15] RunDebugger(::Array{ASTInterpreter2.JuliaStackFrame,1}) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:240
 [16] top-level scope at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:479

@staticfloat
Copy link
Author

Interestingly, using s to step through seems to work whereas n does not.

@Keno
Copy link
Member

Keno commented Jan 18, 2019

I'll assign @KristofferC, since he's taking charge of this.

@KristofferC
Copy link
Member

@Keno, Travis is still not activated here, right?

@Keno
Copy link
Member

Keno commented Jan 18, 2019

I guess it broke when I moved the repo. Let me try setting it up again.

@Keno
Copy link
Member

Keno commented Jan 18, 2019

Alright should be fixed I think.

@staticfloat staticfloat reopened this Jan 20, 2019
@KristofferC KristofferC reopened this Jan 21, 2019
@timholy timholy mentioned this pull request Jan 28, 2019
@KristofferC
Copy link
Member

Should be obsolete.

@KristofferC KristofferC closed this Feb 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants