Attempted to print `nothing` while stepping through `Flux.back!()`

Offen
#8 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
julia
Bereich
devtools

Rechercherichtung

Reproduziere den Fehler, indem du mit @enter schrittweise durch das gemeldete Flux.back!(y)-Beispiel gehst. Beginne bei ASTInterpreter2/src/ASTInterpreter2.jl:180, wo print_next_state den Debugger-Zustand ausgibt, und untersuche den zugehörigen Statuspfad in DebuggerFramework/src/DebuggerFramework.jl:209. Erledigt ist es, wenn das schrittweise Durchlaufen dieses Aufrufs nicht mehr den Druckfehler für nothing auslöst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Example:

using Flux
W = param(randn(10,10))
y = sum(W * randn(10))

Attempting to @enter the Flux.back!(y) works, but halfway through I reliably hit errors when attempting to step within (Core.kwfunc):

julia> @enter Flux.back!(y)
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)

About to run: (isinf)(-24.445557315016536 (tracked))
1|debug > n
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)
17  end

About to run: (isnan)(-24.445557315016536 (tracked))
1|debug > n
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)
17  end
18

About to run: (Core.apply_type)(NamedTuple, (:once,))
1|debug > si
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)
17  end
18

About to run: (tuple)(true)
1|debug > si
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)
17  end
18

About to run: (NamedTuple{(:once,),T} where T<:Tuple)((true,))
1|debug > si
In Type(args) at boot.jl:547
547   NamedTuple{names}(args::Tuple) where {names} = NamedTuple{names,typeof(args)}(args)
548
549   using .Intrinsics: sle_int, add_int

About to run: $(Expr(:static_parameter, 1))
1|debug > finish
In #back!#18(once, , x) at /home/staticfloat/.julia/packages/Flux/T3PhK/src/tracker/lib/real.jl:14
14      isinf(x) && error("Loss is Inf")
15      isnan(x) && error("Loss is NaN")
16      return back!(x, 1, once = once)
17  end
18

About to run: (Core.kwfunc)(Flux.Tracker.back!)
1|debug > si
ERROR: ArgumentError: `nothing` should not be printed; use `show`, `repr`, or custom output instead.
Stacktrace:
 [1] print(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Nothing) at ./show.jl:566
 [2] print_next_state(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::DebuggerFramework.DebuggerState, ::ASTInterpreter2.JuliaStackFrame) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:180
 [3] print_status(::Base.TTY, ::DebuggerFramework.DebuggerState, ::ASTInterpreter2.JuliaStackFrame) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:209
 [4] print_status(::Base.TTY, ::DebuggerFramework.DebuggerState) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:181
 [5] (::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:290
 [6] #invokelatest#1 at ./essentials.jl:754 [inlined]
 [7] invokelatest at ./essentials.jl:753 [inlined]
 [8] 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
 [9] run_interface at /home/staticfloat/tmp/julia-build/julia-master/usr/share/julia/stdlib/v1.2/REPL/src/LineEdit.jl:2267 [inlined]
 [10] RunDebugger(::Array{ASTInterpreter2.JuliaStackFrame,1}, ::REPL.LineEditREPL, ::REPL.Terminals.TTYTerminal) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:314
 [11] RunDebugger(::Array{ASTInterpreter2.JuliaStackFrame,1}) at /home/staticfloat/.julia/dev/DebuggerFramework/src/DebuggerFramework.jl:240
 [12] top-level scope at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:478
Vorherrschende Sprache
Julia
Sterne
9
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus JuliaDebug/DebuggerFramework.jl

Alle Issues in JuliaDebug/DebuggerFramework.jl

Ähnliche Issues

Weitere Issues zu Julia

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.