Skip to content
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

LSTM Model Test Failures #181

Closed
lymichelle21 opened this issue Jan 29, 2025 · 1 comment
Closed

LSTM Model Test Failures #181

lymichelle21 opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lymichelle21
Copy link

lymichelle21 commented Jan 29, 2025

Describe the bug
Error with lstm tests likely due to Tensorflow version.

======================================================================
ERROR: test_full_lstm_model (tests.test_examples.TestExamples.test_full_lstm_model)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/michellely/Documents/GitHub/progpy/tests/test_examples.py", line 22, in test
    ex.run_example()
  File "/Users/michellely/Documents/GitHub/progpy/examples/full_lstm_model.py", line 90, in run_example
    m2 = LSTMThrownObject.from_data(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/src/progpy/data_models/lstm_model.py", line 591, in from_data
    history = model.fit(
              ^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/keras/src/utils/traceback_utils.py", line 123, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/keras/src/trainers/compile_utils.py", line 234, in _build_metrics_set
    raise ValueError(
ValueError: Expected all entries in the `metrics` list to be metric objects. Received instead:
metrics=[['mae']]

Relevant Requirements
Versions of Tensorflow

To Reproduce
Steps to reproduce the behavior:

  1. Use pre-release version
  2. Run tests python -m tests

Expected behavior
Tests pass.

Desktop (please complete the following information):

  • OS: macOS
  • Python Version: 3.12.2
@lymichelle21 lymichelle21 added the bug Something isn't working label Jan 29, 2025
@lymichelle21
Copy link
Author

Additional error with pce tests found - likely due to dependency versions too:

======================================================================
ERROR: test_pce (tests.test_examples.TestExamples.test_pce)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/recurrence/stieltjes.py", line 68, in stieltjes
    return analytical_stieltjes(order=order, dist=dist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/recurrence/stieltjes.py", line 165, in analytical_stieltjes
    coeffs = dist.ttr(mom_order)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/distributions/baseclass/distribution.py", line 721, in ttr
    out[:, idx, idy] = self._get_ttr(kloc_[idx], idx)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/distributions/baseclass/distribution.py", line 732, in _get_ttr
    alpha, beta = self._ttr(kdata, **parameters)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/distributions/operators/joint.py", line 195, in _ttr
    return dist._get_ttr(kloc, idx)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/distributions/baseclass/distribution.py", line 732, in _get_ttr
    alpha, beta = self._ttr(kdata, **parameters)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/distributions/baseclass/simple.py", line 116, in _ttr
    raise chaospy.UnsupportedFeature(
chaospy.UnsupportedFeature: UserDistribution(<bound method Distribution.cdf of Uniform(lower=3, upper=8)>, pdf=<bound method Distribution.pdf of Uniform(lower=3, upper=8)>, ppf=<bound method Distribution.ppf of Uniform(lower=3, upper=8)>): does not support analytical recurrence coefficients.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/michellely/Documents/GitHub/progpy/tests/test_examples.py", line 22, in test
    ex.run_example()
  File "/Users/michellely/Documents/GitHub/progpy/examples/pce.py", line 48, in run_example
    m_surrogate = PCE.from_model(m,
                 ^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/src/progpy/data_models/pce.py", line 186, in from_model
    return cls.from_data(
           ^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/src/progpy/data_models/pce.py", line 107, in from_data
    expansion = cp.generate_expansion(order=params['order'], dist=params['J'])  # Order=2 is the only hyperparameter
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/expansion/frontend.py", line 103, in generate_expansion
    return expansion_function(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/expansion/stieltjes.py", line 122, in stieltjes
    ) = chaospy.stieltjes(numpy.max(order), dist)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/recurrence/stieltjes.py", line 70, in stieltjes
    return discretized_stieltjes(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/recurrence/stieltjes.py", line 111, in discretized_stieltjes
    discretized_stieltjes(
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/chaospy/recurrence/stieltjes.py", line 128, in discretized_stieltjes
    var = numpoly.variable()
          ^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/numpoly/construct/variable.py", line 44, in variable
    return numpoly.symbols(
           ^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/numpoly/construct/symbols.py", line 93, in symbols
    out = numpoly.ndpoly.from_attributes(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/numpoly/baseclass.py", line 388, in from_attributes
    return numpoly.polynomial_from_attributes(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/numpoly/construct/from_attributes.py", line 95, in polynomial_from_attributes
    numpoly.cfrom_attributes(coefficients, poly.values.ravel())
  File "numpoly/cfunctions/cfrom_attributes.pyx", line 22, in numpoly.cfunctions.cfrom_attributes.cfrom_attributes
  File "numpoly/cfunctions/cvalues.pyx", line 124, in numpoly.cfunctions.cvalues.cset_values
  File "numpoly/cfunctions/cvalues.pyx", line 129, in numpoly.cfunctions.cvalues.cset_values
  File "/Users/michellely/Documents/GitHub/progpy/.venv/lib/python3.12/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant