Issue: Misleading "RuleMethodError" exception leading to misleading "inference_postprocess" error (read below) #491
ofSingularMind
started this conversation in
General
Replies: 1 comment 4 replies
-
@ofSingularMind so if I understand correctly, everything would've been good if the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I developed a custom node, with custom update rules and custom meta function. I then duplicated this node with a small adjustment, but forgot to update my
@meta function meta_fn
to provide a meta function for this duplicate-altered node. The below describes the misleading debug signals I received while tracing and fixing this problem.Because my meta-function was wrong, connected variables were not getting updated within
RxInfer.batch_inference()
function calls (presumably because the update rules require a meta function that was unavailable).Within the
function calls inside
RxInfer.batch_inference()
, and utilizing VS Code debugger set to break on All Exceptions, I would receive notice of an exception, aRuleMethodError
, at the following code inReactiveMP.message.jl
.The attached image shows the exception along with the arguments passed for an appropriate update rule. We can notice two things. First, the suggested new rule that might resolve the issue is already exactly included in the list of available rules. Second, when we look at the
ruleargs
, we see the passed variable exactly match these type specifications. So, this was very confusing. But what the exception does not list is the missing meta function. The exception text is included in exception.txt.After this exception is softly thrown, it would be caught within the
RxInfer.batch_inference()
try ... catch routine to fill out a variablepotential_error
below.So, this
potential_error
variable would be filled and then code execution would continue a few lines until the following where posterior inference values are to be post-processed. Because the variables were not being updated from inference, theinference_postprocess
call would fail because it cannot processnothing
values.This is where RxInfer would quit, throwing the error shown in error.txt, summarized as
So, the final fix was to change my meta function from:
to
where
UniSGP_AMF_Grad
is the duplicate-altered function, and this presumably allowed the variables to now find an appropriate update rule to use and all was fixed :)I guess I just don't feel this was the error I wanted to receive for this issue with my code. Maybe there's a better option.
Thanks! Alex
Beta Was this translation helpful? Give feedback.
All reactions