-
Notifications
You must be signed in to change notification settings - Fork 2
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
Mixture is failing to add in Python tutorial 2 #25
Comments
Could you drop the couple of lines of Caesar code that produces this factor in a comment? I can write a unit test against the cloud and see what happens. |
Yep I checked the payloads but can do. |
using IncrementalInference
using DistributedFactorGraphs
fg = initfg()
# add the first node
addVariable!(fg, :x0, ContinuousScalar)
addFactor!(fg, [:x0], Prior(Normal(0,1)))
addVariable!(fg, :x1, ContinuousScalar)
# P(Z | :x1 - :x0 ) where Z ~ Normal(10,1)
addFactor!(fg, [:x0, :x1], LinearRelative(Normal(10.0,1)))
addVariable!(fg, :x2, ContinuousScalar)
mmo = Mixture(LinearRelative,
(hypo1=Rayleigh(3), hypo2=Uniform(30,55)),
[0.4; 0.6])
addFactor!(fg, [:x1, :x2], mmo)
# This factor - x1x2f1 is the one that is not loading.
f = getFactor(fg, :x1x2f1)
|
I'll take a look tonight. |
Thanks! I see a decoding issue in the worker logs, but the payloads look the same.
|
TIMESTAMPS!!! |
Really? |
'Z' is the pattern we have used in the SDK, but maybe the Mixtures code didn't get upgraded to Timezones.jl along with the rest. Not sure the best way to fix this. @Affie Advise? |
The odds of that are low, but I cannot say with certainty 'no'. An error stack would be quick to resolve. By looking blind at the code, I'd be curious if the problem happens above, below, or inside this line: Nothing here suggests that the Timestamp would give an error. Longer term though, it does speak to need for resolving: Tried Two things (FileDFG and Copy-Paste Bug into...)
Also, I think the json string with "-07:00" test.tar.gzjulia> fg
GraphsDFG{SolverParams, DFGVariable, DFGFactor}
UserId: DefaultUser
RobotId: DefaultRobot
SessionId: Session_7c4118
Description: Graphs.jl implementation
Nr variables: 3
Nr factors: 3
User Data: Symbol[]
Robot Data: Symbol[]
Session Data: Symbol[]
julia> saveDFG("test.tar.gz", fg)
julia> fg_ = loadDFG("test.tar.gz")
sfolder = split(dstname, '.') = SubString{String}["test", "tar", "gz"]
[ Info: loadDFG! detected a gzip test.tar.gz -- unpacking via /tmp/caesar/random/e88cb92c now...
[ Info: Loaded 3 variables - [:x0, :x1, :x2]
[ Info: Inserting variables into graph...
┌ Warning: Unable to create measurements and gradients for LinearRelative{1, Normal{Float64}}(Normal{Float64}(μ=10.0, σ=1.0)) during prep of CCW, falling back on no-partial information assumption. Enable ENV["JULIA_DEBUG"] = "IncrementalInference" for @debug printing to see the error.
└ @ IncrementalInference ~/.julia/dev/IncrementalInference/src/services/CalcFactor.jl:405
[ Info: Loaded 3 factors - [:x0f1, :x0x1f1, :x1x2f1]
[ Info: Inserting factors into graph...
[ Info: Rebuilding CCW's for the factors...
┌ Warning: Unable to create measurements and gradients for LinearRelative{1, Normal{Float64}}(Normal{Float64}(μ=10.0, σ=1.0)) during prep of CCW, falling back on no-partial information assumption. Enable ENV["JULIA_DEBUG"] = "IncrementalInference" for @debug printing to see the error.
└ @ IncrementalInference ~/.julia/dev/IncrementalInference/src/services/CalcFactor.jl:405
[ Info: DFG.loadDFG! is deleting a temp folder created during unzip, /tmp/caesar/random/e88cb92c
GraphsDFG{SolverParams, DFGVariable, DFGFactor}
UserId: DefaultUser
RobotId: DefaultRobot
SessionId: Session_763cdb
Description: Graphs.jl implementation
Nr variables: 3
Nr factors: 3
User Data: Symbol[]
Robot Data: Symbol[]
Session Data: Symbol[] json string with
|
Let's write the test and validate the "red herring" assumption that timestamps are the issue. |
No I believe this is a serialization issue unrelated to timestamps. More to follow in a few moments. |
It looks to be related to the way the Dict{string, Any} are converted to NamedTuples that are used to create the distributions and the PackedMixture model. We can discuss in morning. |
Right, there were two bugs. DFG is using JSON2 to unpack the json strings.That is why FileDFG was able to unpack the bug string above. Sam came up against differences between JSON and JSON2 when trying this yesterday. DFG is using JSON2. The right way to unpack factors currently is: Cloud was not yet on IIF v0.27.3Aside, I have a good idea of how to support both JSON and JSON2. Thats happening here: |
Think we can close this now. |
Payload is failing to add, but the content looks to be correct. We should investigate unpacking and resolve.
This is the python packed factor payload:
The text was updated successfully, but these errors were encountered: