richzhang / PerceptualSimilarity

LPIPS metric. pip install lpips
https://richzhang.github.io/PerceptualSimilarity
BSD 2-Clause "Simplified" License
3.64k stars 500 forks source link

Can't import models #43

Closed bakirillov closed 4 years ago

bakirillov commented 4 years ago

Hello!

The following doesn't work: import PerceptualSimilarity.models as psm I have cloned the repository into my working directory and attempt to use the similarity function for my pictures. The import fails with the following error: `ModuleNotFoundError Traceback (most recent call last)

in ----> 1 import PerceptualSimilarity.models as psm ~/HDD/works/Skoltech/CapsuleAD/src/PerceptualSimilarity/models/__init__.py in 9 from torch.autograd import Variable 10 ---> 11 from models import dist_model 12 ModuleNotFoundError: No module named 'models'` What am I doing wrong? Could you please look into it?
richzhang commented 4 years ago

Hi, I refactored the code. You should be able to do a pip install lpips now!

mohit291298 commented 4 years ago

I am still getting the same error (I am using PerceptualSimilarity @ 5d2afe2): raceback (most recent call last): File "scripts/evaluate_changes_clevr.py", line 37, in from PerceptualSimilarity import models File "/home/cse/dual/cs5160433/simsg/PerceptualSimilarity/models/init.py", line 11, in from models import dist_model ModuleNotFoundError: No module named 'models'

And also in import models as utils Please give a fix