-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
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
Labels
No labels