data-validation icon indicating copy to clipboard operation
data-validation copied to clipboard

The latest numpy release 1.24.0 broke TFDV

Open daikeshi opened this issue 2 years ago • 3 comments

TFDV allows 'numpy>=1.16,<2'. However, the latest numpy version 1.24.0 breaks TFDV. I encountered the following error in a TFDV-related component via TFX.

...
venv/lib/python3.8/site-packages/tfx/components/__init__.py:22: in <module>
    from tfx.components.example_validator.component import ExampleValidator
venv/lib/python3.8/site-packages/tfx/components/example_validator/component.py:20: in <module>
    from tfx.components.example_validator import executor
venv/lib/python3.8/site-packages/tfx/components/example_validator/executor.py:20: in <module>
    import tensorflow_data_validation as tfdv
venv/lib/python3.8/site-packages/tensorflow_data_validation/__init__.py:18: in <module>
    from tensorflow_data_validation.api.stats_api import GenerateStatistics
venv/lib/python3.8/site-packages/tensorflow_data_validation/api/stats_api.py:50: in <module>
    from tensorflow_data_validation.statistics import stats_impl
venv/lib/python3.8/site-packages/tensorflow_data_validation/statistics/stats_impl.py:28: in <module>
    from tensorflow_data_validation.statistics.generators import image_stats_generator
venv/lib/python3.8/site-packages/tensorflow_data_validation/statistics/generators/image_stats_generator.py:99: in <module>
    class TfImageDecoder(ImageDecoderInterface):
venv/lib/python3.8/site-packages/tensorflow_data_validation/statistics/generators/image_stats_generator.py:146: in TfImageDecoder
    def get_formats(self, values: List[np.object]) -> np.ndarray:
venv/lib/python3.8/site-packages/numpy/__init__.py:284: in __getattr__
    raise AttributeError("module {!r} has no attribute "
E   AttributeError: module 'numpy' has no attribute 'object'

Python version: 3.8.12 TFX version: 1.6.2 TFDV version: 1.6.0 numpy version: 1.24.0

daikeshi avatar Dec 22 '22 18:12 daikeshi