令人头痛的问题:
Traceback (most recent call last):
File "test.py", line 15, in
from util.visualizer import Visualizer
File "D:\wGAN\mc-gan2\util\visualizer.py", line 15, in
from skimage.measure import compare_ssim as ssim
ImportError: cannot import name 'compare_ssim' from 'skimage.measure' (D:\Anaconda3\envs\torch\lib\site-packages\skimage
\measure\__init__.py)
原因和解决办法:
scikit-image升级后改变了库函数的结构,函数skimage.measure.compare_ssim已经被
skimage.metrics.structural_similarity取代。
参考:
Is there a way to import compare_ssim for python IDLE? - Stack Overflow
As per - https://github.com/scikit-image/scikit-image/blob/b38fd6f02917db2965f5faf2e6e18fc197b8d6c8/skimage/metrics/_structural_similarity.py#L17
versionchanged:: 0.16 This function was renamed from skimage.measure.compare_ssim
to skimage.metrics.structural_similarity
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)