Coder Social home page Coder Social logo

Comments (8)

TouqeerAhmad avatar TouqeerAhmad commented on June 21, 2024

Are you by any chance using an older version of LPIPS. The following excerpt from LPIPS introduction points there are two versions:

"If you use LPIPS in your publication, please specify which version you are using. The current version is 0.1. You can set version='0.0' for the initial release."

from real-world-sr.

TouqeerAhmad avatar TouqeerAhmad commented on June 21, 2024

Never mind about this issue. I was able to get rid of this by importing models and replacing ps with models when initializing the loss network. Specifically, following two lines should address this if anyone else gets the same error:

'from PerceptualSimilarity import models'
'self.loss_network = models.PerceptualLoss(use_gpu=torch.cuda.is_available())'

from real-world-sr.

hcleung3325 avatar hcleung3325 commented on June 21, 2024

Never mind about this issue. I was able to get rid of this by importing models and replacing ps with models when initializing the loss network. Specifically, following two lines should address this if anyone else gets the same error:

'from PerceptualSimilarity import models'
'self.loss_network = models.PerceptualLoss(use_gpu=torch.cuda.is_available())'

Hi Ahmad,
Thanks for your suggestion.
I download the original version, it can import now.
However, there is another problem.

Saving summary into directory runs/save_model/0/
[1/300]: 0%| | 0/50 [00:15<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 186, in
g_loss.backward()
File "/home/root/miniconda/envs/py37/lib/python3.7/site-packages/torch/tensor.py", line 185, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/root/miniconda/envs/py37/lib/python3.7/site-packages/torch/autograd/init.py", line 127, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 256, 1, 1]] is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

Have u experienced this before?

from real-world-sr.

jfun9494 avatar jfun9494 commented on June 21, 2024

@hcleung3325 I remember solving this by using torch==1.1.0

from real-world-sr.

wxslby avatar wxslby commented on June 21, 2024

self.loss_network

Never mind about this issue. I was able to get rid of this by importing models and replacing ps with models when initializing the loss network. Specifically, following two lines should address this if anyone else gets the same error:

'from PerceptualSimilarity import models' 'self.loss_network = models.PerceptualLoss(use_gpu=torch.cuda.is_available())'

Never mind about this issue. I was able to get rid of this by importing models and replacing ps with models when initializing the loss network. Specifically, following two lines should address this if anyone else gets the same error:

'from PerceptualSimilarity import models' 'self.loss_network = models.PerceptualLoss(use_gpu=torch.cuda.is_available())'

Sorry, I can't find "from PerceptualSimilarity import models".Where is the "models"? Can you share the code ?

from real-world-sr.

mrgreen3325 avatar mrgreen3325 commented on June 21, 2024

PerceptualSimilarity

You can download the PerceptualSimilarity package.
Or I email you the package, what is your email?

from real-world-sr.

wxslby avatar wxslby commented on June 21, 2024

Thanks for your reply. My email is [email protected]. Please!

from real-world-sr.

cgysjy avatar cgysjy commented on June 21, 2024

The downloaded perceptualsimilarity works, but still reports an error:
AttributeError: module 'PerceptualSimilarity' has no attribute 'PerceptualLoss'.
The current lpips minimum version 1.0 cannot be reduced to 0.0.
I did not find models for the above solution.
Is there any other solution? Thank you!

from real-world-sr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.