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

Download step "np.object" error #33

Open
BatuhanYilmaz opened this issue May 13, 2024 · 1 comment
Open

Download step "np.object" error #33

BatuhanYilmaz opened this issue May 13, 2024 · 1 comment

Comments

@BatuhanYilmaz
Copy link

BatuhanYilmaz commented May 13, 2024

Greetings,

I forked the repository and when I try to test the download step from the main project, I expected it to work from components/get_data with the script below:

mlflow run . -P steps="download"

On the other hand, I am stuch with these errors:

/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/types/schema.py:49: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  binary = (7, np.dtype("bytes"), "BinaryType", np.object)
Traceback (most recent call last):
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/bin/mlflow", line 7, in <module>
    from mlflow.cli import cli
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/__init__.py", line 52, in <module>
    import mlflow.fastai as fastai  # noqa: E402
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/fastai.py", line 22, in <module>
    from mlflow import pyfunc
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/pyfunc/__init__.py", line 219, in <module>
    import mlflow.pyfunc.model
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/pyfunc/model.py", line 17, in <module>
    from mlflow.models import Model
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/models/__init__.py", line 25, in <module>
    from .signature import ModelSignature, infer_signature
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/models/signature.py", line 12, in <module>
    from mlflow.types.schema import Schema
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/types/__init__.py", line 6, in <module>
    from .schema import DataType, ColSpec, Schema, TensorSpec
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/types/schema.py", line 20, in <module>
    class DataType(Enum):
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/types/schema.py", line 49, in DataType
    binary = (7, np.dtype("bytes"), "BinaryType", np.object)
  File "/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
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

I suspect that the dependencies are a bit old, since the last commit is done about two years ago.
Do you have any idea how can we solve this problem?

@Mohamedadlyi
Copy link

Mohamedadlyi commented Jun 19, 2024

hello, I know a workaround by editing line 49 in the file

/home/teamx/miniconda3/envs/nyc_airbnb_dev/lib/python3.9/site-packages/mlflow/types/schema.py

binary = (7, np.dtype("bytes"), "BinaryType", np.object)

to

binary = (7, np.dtype("bytes"), "BinaryType", object)

and another solution is to install older numpy version < 1.20.0, but i don't recommend this as it will cause other conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants