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

type DataType has no field var #142

Closed
torfjelde opened this issue Jul 30, 2019 · 1 comment
Closed

type DataType has no field var #142

torfjelde opened this issue Jul 30, 2019 · 1 comment

Comments

@torfjelde
Copy link

torfjelde commented Jul 30, 2019

using Cassette, Turing

Cassette.@context AssumeCtx

@model gdemo(x) = begin
    s ~ InverseGamma(2, 3)
    
    m ~ Normal(0, sqrt(s))
    x ~ Normal(m, sqrt(s))
    return s, m
end

m = gdemo(1.0)
samples = Cassette.overdub(AssumeCtx(), sample, m, MH(10));

Results in the following error

ERROR: type DataType has no field var
Stacktrace:
 [1] getproperty at ./sysimg.jl:15 [inlined]
 [2] call at /home/tor/.julia/dev/Cassette/src/context.jl:447 [inlined]
 [3] fallback at /home/tor/.julia/dev/Cassette/src/context.jl:445 [inlined]
 [4] overdub at /home/tor/.julia/dev/Cassette/src/context.jl:271 [inlined]
 [5] supertype at ./operators.jl:50 [inlined]
 [6] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(supertype), ::Type{Array{T,1} where T}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [7] typejoin at ./promotion.jl:116 [inlined]
 [8] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(typejoin), ::Type{StepRange{Int64,Int64}}, ::Type{Array{T,1} where T}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [9] typejoin at ./promotion.jl:28 [inlined]
 [10] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(typejoin), ::Type{StepRange{Int64,Int64}}, ::Type{Array{T,1} where T}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [11] promote_result at ./promotion.jl:242 [inlined]
 [12] promote_type at ./promotion.jl:221 [inlined]
 [13] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(promote_type), ::Type{StepRange{Int64,Int64}}, ::Type{Array{T,1} where T}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [14] promote_typeof at ./promotion.jl:264 [inlined]
 [15] vect at ./array.jl:148 [inlined]
 [16] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(Base.vect), ::StepRange{Int64,Int64}, ::Array{String,1}, ::Array{Int64,1}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [17] #Chains#12 at /home/tor/.julia/packages/MCMCChains/loNyJ/src/chains.jl:47 [inlined]
 [18] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::getfield(MCMCChains, Symbol("##Chains#12")), ::Int64, ::Int64, ::Float64, ::NamedTuple{(:samples,),Tuple{Array{Turing.Utilities.Sample,1}}}, ::Type{Chains}, ::Array{Union{Missing, Float64},3}, ::Array{String,1}, ::Dict{Symbol,Array{String,1}}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [19] Type at ./none:0 [inlined]
 [20] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::getfield(Core, Symbol("#kw#Type")), ::NamedTuple{(:evidence, :info),Tuple{Float64,NamedTuple{(:samples,),Tuple{Array{Turing.Utilities.Sample,1}}}}}, ::Type{Chains}, ::Array{Union{Missing, Float64},3}, ::Array{String,1}, ::Dict{Symbol,Array{String,1}}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [21] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(Turing.Utilities.Chain), ::Float64, ::Array{Turing.Utilities.Sample,1}) at /home/tor/.julia/dev/Turing/src/utilities/io.jl:84
 [22] #sample#34 at /home/tor/.julia/dev/Turing/src/inference/mh.jl:171 [inlined]
 [23] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::getfield(Turing.Inference, Symbol("##sample#34")), ::Bool, ::Nothing, ::Int64, ::typeof(sample), ::Turing.Model{Tuple{:s,:m},Tuple{:x},getfield(Main, Symbol("###inner_function#374#9")),NamedTuple{(:x,),Tuple{Float64}},NamedTuple{(:x,),Tuple{Symbol}}}, ::MH{()}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [24] sample at /home/tor/.julia/dev/Turing/src/inference/mh.jl:113 [inlined]
 [25] overdub(::Cassette.Context{nametype(AssumeCtx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(sample), ::Turing.Model{Tuple{:s,:m},Tuple{:x},getfield(Main, Symbol("###inner_function#374#9")),NamedTuple{(:x,),Tuple{Float64}},NamedTuple{(:x,),Tuple{Symbol}}}, ::MH{()}) at /home/tor/.julia/dev/Cassette/src/overdub.jl:0
 [26] top-level scope at none:0

I'm using Cassette#master here as it seemed potentially related to #127. It also failed when running on non-master Cassette.

Given that https://github.com/JuliaLang/julia/blob/5aea4569e988c6e231a2d9204c7e39193b961891/base/operators.jl#L50 seems to be "causing" the issue, it's also probably related to #130?

versioninfodump:

Julia Version 1.0.4
Commit 38e9fb7f80 (2019-05-16 03:38 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 7 1700X Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, znver1)
@vchuravy
Copy link
Member

vchuravy commented Aug 4, 2019

Yeah looks like a dup of #130

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