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

Đang mở
#8 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
julia
Lĩnh vực
devtools

Hướng nghiên cứu

Reproduce the failure by stepping through the reported Flux.back!(y) example with @enter. Start at ASTInterpreter2/src/ASTInterpreter2.jl:180, where print_next_state prints the debugger state, and inspect the related status path in DebuggerFramework/src/DebuggerFramework.jl:209. Done means stepping through this call no longer raises the nothing printing error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Julia
Star
9
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaDebug/DebuggerFramework.jl

Tất cả issue của JuliaDebug/DebuggerFramework.jl

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.