gpt4 book ai didi

python - import skimage 有效,但 skimage.measure 无效

转载 作者:行者123 更新时间:2023-12-05 09:12:14 25 4
gpt4 key购买 nike

我得到了

from skimage.measure import find_contours
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-2cf88a5f2300> in <module>()
----> 1 from skimage.measure import find_contours

ImportError: No module named 'skimage.measure'

同样,如果我简单地导入 skimage 并尝试调用 skimage.measure.find_contours,我会得到

AttributeError: module 'skimage' has no attribute 'measure' 

import skimage 不会抛出错误,只是似乎没有附加任何东西:

import skimage

skimage.__version__
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-846cd4ef3ef8> in <module>()
----> 1 skimage.__version__

AttributeError: module 'skimage' has no attribute '__version__'

skimage 已安装:

(User) C:\Users\angel_000>pip3 install scikit-image --user
Requirement already satisfied: scikit-image in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (0.15.0)
Requirement already satisfied: imageio>=2.0.1 in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from scikit-image) (2.5.0)
Requirement already satisfied: networkx>=2.0 in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from scikit-image) (2.2)
Requirement already satisfied: PyWavelets>=0.4.0 in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from scikit-image) (0.5.2)
Requirement already satisfied: pillow>=4.3.0 in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from scikit-image) (5.2.0)
Requirement already satisfied: numpy in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from imageio>=2.0.1->scikit-image) (1.16.1)
Requirement already satisfied: decorator>=4.3.0 in c:\users\angel_000\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages (from networkx>=2.0->scikit-image) (4.4.0)
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

我在这里找到了类似问题的人https://gitmemory.com/issue/scikit-image/scikit-image/3731/505817873但没有解决方案。

我也试过

from skimage import measure

ImportError: cannot import name 'measure'

最佳答案

在 0.18.x 版本中,它又发生了变化。执行以下操作:

from skimage import metrics

metrics.structural_similarity(grayA, grayB, full=True)

关于python - import skimage 有效,但 skimage.measure 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58811262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com