8000 DeprecationWarning using segmentation.slic · Issue #4822 · scikit-image/scikit-image · GitHub
[go: up one dir, main page]

Skip to content
DeprecationWarning using segmentation.slic #4822
@ntjess

Description

@ntjess

Description

The example code for slic results in a DeprecationWarning.

Way to reproduce

from skimage.segmentation import slic
from skimage.data import astronaut
img = astronaut()
segments = slic(img, n_segments=100, compactness=10)

Output:

Traceback (most recent call last):
  File "<input>", line 4, in <module>
  File "C:\Users\ntjes\miniconda3\envs\py38\lib\site-packages\skimage\segmentation\slic_superpixels.py", line 206, in slic
    image = img_as_float(image)
  File "C:\Users\ntjes\miniconda3\envs\py38\lib\site-packages\skimage\util\dtype.py", line 452, in img_as_float
    return _convert(image, np.floating, force_copy)
  File "C:\Users\ntjes\miniconda3\envs\py38\lib\site-packages\skimage\util\dtype.py", line 226, in _convert
    dtypeobj_out = np.dtype(dtype)
DeprecationWarning: Converting `np.inexact` or `np.floating` to a dtype is deprecated. The current result is `float64` which is not strictly correct.

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
3.8.3 (default, Jul  2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)]
Windows-10-10.0.18362-SP0
scikit-image version: 0.17.2
numpy version: 1.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0