Closed krichelj closed 1 year ago
This is an issue with the PySDD package, not DeepProbLog. However, I know that PySDD fails to compile for Python 3.11 on macOS. Please try Python 3.10 instead.
Tried it again with Python 3.10 and it's still not working. How would you recommend opening an issue on this in PySDD?
Can you show the output of the pip install? Are you using x64 or an ARM processor?
@rmanhaeve I'm using the Apple M1 with an ARM processor.
The pip install ran fine, running python -m deepproblog test
results in:
` ============================================================== test session starts =============================================================== platform darwin -- Python 3.10.8, pytest-7.2.2, pluggy-1.0.0 collected 49 items / 2 skipped
venv/lib/python3.10/site-packages/deepproblog/tests/test_cache.py ............s....... [ 40%] venv/lib/python3.10/site-packages/deepproblog/tests/test_dataset.py ........ [ 57%] venv/lib/python3.10/site-packages/deepproblog/tests/test_model.py s..sFF [ 69%] venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py s..sFFsFFsFFsF. [100%]
==================================================================== FAILURES ==================================================================== ___ test_solve[model1] ___
model = <deepproblog.model.Model object at 0x1617d7250>
def test_solve(model):
q1 = Query(parse("equal(dummy,dummy)."))
q2 = Query(parse("equal(dummy,notequal)."))
q3 = Query(parse("multiple_answers(X)."))
q4 = Query(parse("a."))
results = model.solve([q1, q2, q3, q4])
venv/lib/python3.10/site-packages/deepproblog/tests/test_model.py:49:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1617f8a30>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ___ test_solve[model2] ___
model = <deepproblog.model.Model object at 0x162243c70>
def test_solve(model):
q1 = Query(parse("equal(dummy,dummy)."))
q2 = Query(parse("equal(dummy,notequal)."))
q3 = Query(parse("multiple_answers(X)."))
q4 = Query(parse("a."))
results = model.solve([q1, q2, q3, q4])
venv/lib/python3.10/site-packages/deepproblog/tests/test_model.py:49:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1621fde10>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------- Caching ACs ____ test_adnetwork[model1] ____
model = <deepproblog.model.Model object at 0x162316110>
def test_ad_network(model: Model):
q1 = Query(Term("test1", Term("i1"), Term("a"), Term("i2"), Term("b"))) # p = 0.24
q2 = Query(Term("test1", Term("i1"), Term("a"), Term("i2"), Term("a"))) # p = 0.16
q3 = Query(Term("test1", Term("i1"), Term("a"), Term("i1"), Term("b"))) # p = 0
results = model.solve([q1, q2, q3])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:62:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x16218fdc0>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ____ test_adnetwork[model2] ____
model = <deepproblog.model.Model object at 0x1623abd60>
def test_ad_network(model: Model):
q1 = Query(Term("test1", Term("i1"), Term("a"), Term("i2"), Term("b"))) # p = 0.24
q2 = Query(Term("test1", Term("i1"), Term("a"), Term("i2"), Term("a"))) # p = 0.16
q3 = Query(Term("test1", Term("i1"), Term("a"), Term("i1"), Term("b"))) # p = 0
results = model.solve([q1, q2, q3])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:62:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1617d7ac0>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------- Caching ACs ___ test_fact_network[model1] ____
model = <deepproblog.model.Model object at 0x16208e4a0>
def test_fact_network(model: Model):
q1 = Query(Term("test2", Term("i1"), Term("i2"))) # p = 0.32
q2 = Query(Term("test2", Term("i1"), Term("i1"))) # p = 0.8
results = model.solve([q1, q2])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:74:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1620e7c70>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ___ test_fact_network[model2] ____
model = <deepproblog.model.Model object at 0x16243fbe0>
def test_fact_network(model: Model):
q1 = Query(Term("test2", Term("i1"), Term("i2"))) # p = 0.32
q2 = Query(Term("test2", Term("i1"), Term("i1"))) # p = 0.8
results = model.solve([q1, q2])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:74:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x162222470>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------- Caching ACs ____ test_det_network[model1] ____
model = <deepproblog.model.Model object at 0x16218ec80>
def test_det_network(model: Model):
results = model.solve([Query(Term("test3", Term("i1"), Var("X"))), Query(Term("test3", Term("i2"), Var("X")))])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:82:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1620b19c0>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ____ test_det_network[model2] ____
model = <deepproblog.model.Model object at 0x16234b7c0>
def test_det_network(model: Model):
results = model.solve([Query(Term("test3", Term("i1"), Var("X"))), Query(Term("test3", Term("i2"), Var("X")))])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:82:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1620f7be0>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sddformula.py:72: InstallError ------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------- Caching ACs ____ test_det_network_substitution[model1] __
model = <deepproblog.model.Model object at 0x162220430>
def test_det_network_substitution(model: Model):
if not model.solver.cache.cache:
q1 = Query(Term("test3", Term("a"), Var("X")), {Term("a"): Term("i1")})
q2 = Query(Term("test3", Term("a"), Var("X")), {Term("a"): Term("i2")})
results = model.solve([q1, q2])
venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py:95:
venv/lib/python3.10/site-packages/deepproblog/model.py:117: in solve
return self.solver.solve(batch)
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in solve
acs: List[ArithmeticCircuit] = [self.cache.get(q) for q in batch]
venv/lib/python3.10/site-packages/deepproblog/solver.py:86: in
self = <problog.sdd_formula.SDD object at 0x1617b69e0>, sdd_auto_gc = False, var_constraint = None, init_varcount = -1, kwdargs = {}
def __init__(
self, sdd_auto_gc=False, var_constraint=None, init_varcount=-1, **kwdargs
):
"""
Create an SDD
:param sdd_auto_gc: Auto garbage collection and minimize (during disjoin and conjoin)
:param var_constraint: A variable ordering constraint. Currently only x_constrained namedtuple are allowed.
:type var_constraint: x_constrained
:param init_varcount: The amount of variables to initialize the manager with.
:param kwdargs:
:raise InstallError: When the SDD library is not available.
"""
if sdd is None:
raise InstallError(
"The SDD library is not available. Please install the PySDD package." ) E problog.errors.InstallError: The SDD library is not available. Please install the PySDD package..
venv/lib/python3.10/site-packages/problog/sdd_formula.py:72: InstallError ================================================================ warnings summary ================================================================ venv/lib/python3.10/site-packages/deepproblog/engines/init.py:6 venv/lib/python3.10/site-packages/deepproblog/engines/init.py:6: UserWarning: ApproximateEngine is not available as PySwip could not be found warnings.warn("ApproximateEngine is not available as PySwip could not be found")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================================================ short test summary info ============================================================= FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_model.py::test_solve[model1] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_model.py::test_solve[model2] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_ad_network[model1] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_ad_network[model2] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_fact_network[model1] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_fact_network[model2] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_det_network[model1] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_det_network[model2] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. FAILED venv/lib/python3.10/site-packages/deepproblog/tests/test_neural_predicate.py::test_det_network_substitution[model1] - problog.errors.InstallError: The SDD library is not available. Please install the PySDD package.. ============================================== 9 failed, 32 passed, 10 skipped, 1 warning in 1.55s ===============================================`
The pysdd package is now pre-compiled for Python3.11 and macOS 13 (Ventura): https://files.pythonhosted.org/packages/44/3a/b5a3bbb6448f1a52c71561986284d46281dc23c9e627f03444527025b351/PySDD-0.2.11-cp311-cp311-macosx_13_0_arm64.whl
It might help to force a reinstall for pysdd:
pip install --force-reinstall pysdd
Pay attention to use Python 3.11. The test logs indicate you are using a virtual environment with Python 3.10 (e.g. venv/lib/python3.10/site-packages/deepproblog/
).
@wannesm Tried what you suggested with Python 3.11 and it worked, thanks!
Describe the bug 9 given tests fail, displaying an error 'The SDD library is not available'
To Reproduce run
pip install deepproblog
, runpip install pytest
and thenpython -m deepproblog test
Expected behavior 9 tests should pass
Desktop