pbnt icon indicating copy to clipboard operation
pbnt copied to clipboard

error for the code

Open Fangwq opened this issue 6 years ago • 2 comments

An error has been encountered when I run: python exampleinference.py The error is as follows:

Traceback (most recent call last): File "./pbnt-master/examples/exampleinference.py", line 82, in inferenceExample() File "./pbnt-master/examples/exampleinference.py", line 67, in inferenceExample Q = engine.marginal(sprinkler)[0] File "../lib/pbnt/Inference.py", line 257, in marginal self.global_propagation() File "../lib/pbnt/Inference.py", line 287, in global_propagation self.collect_evidence(0, startClique, 0, True) File "../lib/pbnt/Inference.py", line 297, in collect_evidence self.collect_evidence(currentClique, neighbor, sep, 0) File "../lib/pbnt/Inference.py", line 297, in collect_evidence self.collect_evidence(currentClique, neighbor, sep, 0) File "../lib/pbnt/Inference.py", line 301, in collect_evidence self.pass_message(currentClique, prevClique, sepset) File "../lib/pbnt/Inference.py", line 315, in pass_message oldSepsetPotential = self.project(fromClique, sepset) File "../lib/pbnt/Inference.py", line 324, in project sepset.potential = clique.potential.marginalize(sepset.potential) File "../lib/pbnt/Distribution.py", line 66, in marginalize index = self.generate_index_node(seq, intersect) File "../lib/pbnt/Distribution.py", line 94, in generate_index_node return self.generate_index(index, axes) File "../lib/pbnt/Distribution.py", line 105, in generate_index tmp[axis] = index ValueError: shape mismatch: value array of shape (3,) could not be broadcast to indexing result of shape (2,)

I use python2.7 with Mac OS. Can you help me?

Fangwq avatar Jan 03 '19 16:01 Fangwq

Did you solve it?

toanbku avatar Jun 28 '20 09:06 toanbku

@toanbku Sorry, I do not use this package any more. So I don't solve it.

Fangwq avatar Jun 29 '20 00:06 Fangwq