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

[Failing Test]: Beam ML unit tests fail with Keras 3.3.3 and TF 2.16.1 #31294

Open
1 of 16 tasks
tvalentyn opened this issue May 14, 2024 · 2 comments
Open
1 of 16 tasks

Comments

@tvalentyn
Copy link
Contributor

What happened?

Sample failure:

$ pytest apache_beam/ml/inference/tensorflow_inference_test.py::TFRunInferenceTest::test_predict_numpy_with_batch_size
================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.9.18, pytest-7.4.4, pluggy-1.5.0
rootdir: /home/valentyn/projects/beam/beam/beam/sdks/python
configfile: pytest.ini
plugins: xdist-3.6.1, requests-mock-1.12.1, timeout-2.3.1, hypothesis-6.102.1
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 1 item                                                                                                                                                                                                                                                                         

apache_beam/ml/inference/tensorflow_inference_test.py F                                                                                                                                                                                                                            [100%]

======================================================================================================================================== FAILURES ========================================================================================================================================
_________________________________________________________________________________________________________________ TFRunInferenceTest.test_predict_numpy_with_batch_size __________________________________________________________________________________________________________________

self = <apache_beam.ml.inference.tensorflow_inference_test.TFRunInferenceTest testMethod=test_predict_numpy_with_batch_size>

    def test_predict_numpy_with_batch_size(self):
>     model = _create_mult2_model()

apache_beam/ml/inference/tensorflow_inference_test.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/ml/inference/tensorflow_inference_test.py:68: in _create_mult2_model
    inputs = tf.keras.Input(shape=(3))
test-suites/tox/py39/build/srcs/sdks/python/target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/keras/src/layers/core/input_layer.py:143: in Input
    layer = InputLayer(
test-suites/tox/py39/build/srcs/sdks/python/target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/keras/src/layers/core/input_layer.py:46: in __init__
    shape = backend.standardize_shape(shape)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

shape = 3

    def standardize_shape(shape):
        if not isinstance(shape, tuple):
            if shape is None:
                raise ValueError("Undefined shapes are not supported.")
            if not hasattr(shape, "__iter__"):
>               raise ValueError(f"Cannot convert '{shape}' to a shape.")
E               ValueError: Cannot convert '3' to a shape.

test-suites/tox/py39/build/srcs/sdks/python/target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/keras/src/backend/common/variables.py:530: ValueError

Issue Failure

Failure: Test is continually failing

Issue Priority

Priority: 2 (backlog / disabled test but we think the product is healthy)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
@tvalentyn
Copy link
Contributor Author

cc: @damccorm - we might want to prioritize #30908.

@tvalentyn
Copy link
Contributor Author

to repro:

gradlew :sdks:python:test-suites:tox:py39:testPy39ML -Pposargs=apache_beam/ml/

tvalentyn added a commit to tvalentyn/beam that referenced this issue May 14, 2024
tvalentyn added a commit that referenced this issue May 15, 2024
* Don't install TFT on Python 3.11+

* Add an upper bound to TF due to #31294 .

* Run huggingface tests without parallelism: see comments in #31287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant