You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Numpy 1.24 deprecates ragged array creation will now always raise a ValueError unless dtype=object is passed. This includes very deeply nested sequences. Previously, VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. will be thown.
Test case in test_multiclass.py, i.e. [np.array([]), np.array([1, 2, 3])], will raise AttributeError: 'list' object has no attribute 'array'
To Reproduce
To help us reproducing this bug, please provide information below:
Your Python version: v3.8.13
The version of Mars you use: master
Versions of crucial packages: numpy v1.24.1
Full stack of the error.
Minimized code to reproduce the error.
pytest mars/learn/utils/tests/test_multiclass.py::test_unique_labels_non_specific
or
import numpy as np
a = [np.array([]), np.array([1, 2, 3])]
np.asarray(a)
Expected behavior
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
vcfgv
changed the title
[BUG] Creating an ndarray from ragged nested sequences is deprecated since numpy 1.24 which will cause tensor error
[BUG] Creating an ndarray from ragged nested sequences is deprecated since numpy 1.24
Jan 13, 2023
Describe the bug
Numpy 1.24 deprecates ragged array creation will now always raise a ValueError unless dtype=object is passed. This includes very deeply nested sequences. Previously, VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. will be thown.
Test case in test_multiclass.py, i.e. [np.array([]), np.array([1, 2, 3])], will raise AttributeError: 'list' object has no attribute 'array'
To Reproduce
To help us reproducing this bug, please provide information below:
pytest mars/learn/utils/tests/test_multiclass.py::test_unique_labels_non_specific
or
Expected behavior
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: