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

[0.23.2] test_active_contour_model.py fails on mips64el #7425

Open
olebole opened this issue May 19, 2024 · 0 comments
Open

[0.23.2] test_active_contour_model.py fails on mips64el #7425

olebole opened this issue May 19, 2024 · 0 comments
Labels

Comments

@olebole
Copy link
Contributor

olebole commented May 19, 2024

Description:

When building the Debian package for 0.23.2, I observe a number of test failures in skimage/segmentation/tests/test_active_contour_model.py, namely test_periodic_reference, test_fixed_reference, test_free_reference, test_RGB (all for all tested dtypes). The failure is

_______________________ test_periodic_reference[float32] _______________________

dtype = <class 'numpy.float32'>

    @pytest.mark.parametrize('dtype', [np.float16, np.float32, np.float64])
    def test_periodic_reference(dtype):
        img = data.astronaut()
        img = rgb2gray(img)
        s = np.linspace(0, 2 * np.pi, 400)
        r = 100 + 100 * np.sin(s)
        c = 220 + 100 * np.cos(s)
        init = np.array([r, c]).T
        img_smooth = gaussian(img, sigma=3, preserve_range=False).astype(dtype, copy=False)
        snake = active_contour(
            img_smooth, init, alpha=0.015, beta=10, w_line=0, w_edge=1, gamma=0.001
        )
        assert snake.dtype == _supported_float_type(dtype)
        refr = [98, 99, 100, 101, 102, 103, 104, 105, 106, 108]
        refc = [299, 298, 298, 298, 298, 297, 297, 296, 296, 295]
>       assert_equal(np.array(snake[:10, 0], dtype=np.int32), refr)

skimage/segmentation/tests/test_active_contour_model.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<built-in function eq>, array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32), [98, 99, 100, 101, 102, 103, ...])
kwds = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not equal
E           
E           Mismatched elements: 10 / 10 (100%)
E           Max absolute difference: 108
E           Max relative difference: 1.
E            x: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32)
E            y: array([ 98,  99, 100, 101, 102, 103, 104, 105, 106, 108])

/usr/lib/python3.11/contextlib.py:81: AssertionError

On other platforms, these tests pass. I also did not observe it on 0.23.1.

Way to reproduce:

Mips64el is 64-bit little endian.
Full build log (inclusive tests) here.

Version information:

* Python 3.11.9 and 3.12.3
* numpy 1.26.4
* skimage 0.23.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant