pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

BUG: Tests fail: ValueError: The tag 'local_0_dot_x' is already present in the database

Open yurivict opened this issue 2 years ago • 6 comments

Describe the issue:

============================================================================================================ ERRORS ============================================================================================================
_____________________________________________________________________________________ ERROR collecting pytensor/misc/elemwise_time_test.py _____________________________________________________________________________________
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:972: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:972: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:680: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:850: in exec_module
    ???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
    ???
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:2674: in <module>
    local_one_plus_erf = PatternNodeRewriter(
pytensor/graph/rewriting/basic.py:1570: in __init__
    from pytensor.graph.rewriting.unify import convert_strs_to_vars
pytensor/graph/rewriting/unify.py:19: in <module>
    from etuples import apply, etuple, etuplize
/usr/local/lib/python3.9/site-packages/etuples/__init__.py:2: in <module>
    from .core import etuple
/usr/local/lib/python3.9/site-packages/etuples/core.py:343: in <module>
    def etuple(*args, **kwargs):
/usr/local/lib/python3.9/site-packages/multipledispatch/core.py:68: in _
    dispatcher.add(types, func, on_ambiguity=on_ambiguity)
/usr/local/lib/python3.9/site-packages/multipledispatch/dispatcher.py:133: in add
    raise TypeError("Tried to dispatch on non-type: %s\n"
E   TypeError: Tried to dispatch on non-type: [<class 'object'>]
E   In signature: <[<class 'object'>]>
E   In function: etuple
__________________________________________________________________________________________ ERROR collecting tests/test_breakpoint.py ___________________________________________________________________________________________
tests/test_breakpoint.py:3: in <module>
    from pytensor.breakpoint import PdbBreakpoint
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
____________________________________________________________________________________________ ERROR collecting tests/test_config.py _____________________________________________________________________________________________
tests/test_config.py:8: in <module>
    from pytensor import configdefaults, configparser
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
___________________________________________________________________________________________ ERROR collecting tests/test_gradient.py ____________________________________________________________________________________________
tests/test_gradient.py:6: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
____________________________________________________________________________________________ ERROR collecting tests/test_ifelse.py _____________________________________________________________________________________________
tests/test_ifelse.py:7: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
___________________________________________________________________________________________ ERROR collecting tests/test_printing.py ____________________________________________________________________________________________
tests/test_printing.py:11: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
___________________________________________________________________________________________ ERROR collecting tests/test_raise_op.py ____________________________________________________________________________________________
tests/test_raise_op.py:5: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
______________________________________________________________________________________________ ERROR collecting tests/test_rop.py ______________________________________________________________________________________________
tests/test_rop.py:18: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
____________________________________________________________________________________________ ERROR collecting tests/test_updates.py ____________________________________________________________________________________________
tests/test_updates.py:3: in <module>
    import pytensor
pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
pytensor/tensor/__init__.py:112: in <module>
    import pytensor.tensor.rewriting
pytensor/tensor/rewriting/__init__.py:11: in <module>
    import pytensor.tensor.rewriting.math
pytensor/tensor/rewriting/math.py:161: in <module>
    def local_0_dot_x(fgraph, node):
pytensor/tensor/rewriting/basic.py:166: in register_stabilize
    compile.optdb["stabilize"].register(
pytensor/graph/rewriting/db.py:339: in register
    super().register(name, rewriter, *tags, **kwargs)
pytensor/graph/rewriting/db.py:71: in register
    raise ValueError(f"The tag '{name}' is already present in the database.")
E   ValueError: The tag 'local_0_dot_x' is already present in the database.
======================================================================================================= warnings summary =======================================================================================================
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
../../../../../local/lib/python3.9/site-packages/multipledispatch/core.py:79
  /usr/local/lib/python3.9/site-packages/multipledispatch/core.py:79: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
    spec = inspect.getargspec(func)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 9 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================ 8 warnings, 9 errors in 10.00s ================================================================================================

Reproducable code example:

pytest .

Error message:

See above.

PyTensor version information:

2.12.3

Context for the issue:

Python-3.9 FreeBSD 13.2

yurivict avatar Jun 21 '23 02:06 yurivict

Closing in favor of https://github.com/pymc-devs/pytensor/discussions/358

ricardoV94 avatar Jun 23 '23 06:06 ricardoV94

This issue has nothing to do with https://github.com/pymc-devs/pytensor/discussions/358

yurivict avatar Jun 23 '23 06:06 yurivict

@ricardoV94

2.23.0 still has the same problem.

yurivict avatar Jun 24 '24 04:06 yurivict

@yurivict I assume it's a FreeBSD installation specific problem?

ricardoV94 avatar Jun 24 '24 04:06 ricardoV94

I assume it's a FreeBSD installation specific problem?

No, I don't think so. The tests are just failing.

yurivict avatar Jun 24 '24 04:06 yurivict

They are certainly passing in our CI and in Conda forge, as well as users of PyTensor via PyMC (our most common downstream usage). Or we would have heard about it already. Can you provide a reproducible example via our official installation stream (pip or conda)?

ricardoV94 avatar Jun 24 '24 06:06 ricardoV94