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

fix import bug with relative paths #25

Closed
wants to merge 6 commits into from

Conversation

IShengFang
Copy link

@IShengFang IShengFang commented May 14, 2019

The original version is absolute import.
It causes error during import from outside.
I change it with explicit relative import.

I also fixed bug of "PerceptualLoss no attribute '_forward_pre_hooks' " in init.py

@richzhang
Copy link
Owner

Thanks for the PerceptualLoss fix.

I end up getting import errors when trying this.

  File "compute_dists_dirs.py", line 5, in <module>
    import models.dist_model as dm
  File "/mnt/src/PerceptualSimilarity/models/dist_model.py", line 14, in <module>
    from .base_model import BaseModel
  File "/mnt/src/PerceptualSimilarity/models/base_model.py", line 3, in <module>
    from ..util import util
ValueError: Attempted relative import beyond toplevel package

@IShengFang
Copy link
Author

oh
I am sorry that I didn't test the test code under the repository.
I repacked module and fixed bug[1].
[1] #25 (comment)

@richzhang
Copy link
Owner

Thanks for your PR! Somehow this got fixed at some point (I don't remember when). There is also a pip install lpips now, feel free to try it :)

@richzhang richzhang closed this Sep 7, 2020
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

Successfully merging this pull request may close these issues.

2 participants