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

Colab notebook error because of compare_ssim #12

Open
tristansyates opened this issue Dec 11, 2021 · 1 comment
Open

Colab notebook error because of compare_ssim #12

tristansyates opened this issue Dec 11, 2021 · 1 comment

Comments

@tristansyates
Copy link

Thanks for providing this code!

When trying to run the following cell in the the Colaboratory notebook to project an input image to latent space :

#Project your own image and Make Eigenvector of latent spaces (by pretrained model)

!python projector.py --ckpt=/content/Cartoon-StyleGan2/networks/ffhq256.pt --factor='networks/factor' --e_ckpt=/content/Cartoon-StyleGan2/networks/encoder_ffhq.pt \
                            --files=/content/Cartoon-StyleGan2/celea.jpg 

I get the following error:

ImportError: cannot import name 'compare_ssim' from 'skimage.measure' (/usr/local/lib/python3.7/dist-packages/skimage/measure/init.py)

This seems to be because /usr/local/lib/python3.7/dist-packages/skimage/measure/__init__.py uses 'skimage.measure.compare_ssim' when it was recently changed to 'skimage.metrics.structural_similarity'

Link talking about skimage update: williamfzc/stagesepx#150

@nampyohong
Copy link

nampyohong commented Jan 4, 2022

change line in "lpips/init.py", line 7

from
from skimage.measure import compare_ssim

to
from skimage.metrics import structural_similarity as compare_ssim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants