Comments (8)
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.
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.
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.
@hcleung3325 I remember solving this by using torch==1.1.0
from real-world-sr.
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.
PerceptualSimilarity
You can download the PerceptualSimilarity package.
Or I email you the package, what is your email?
from real-world-sr.
Thanks for your reply. My email is [email protected]. Please!
from real-world-sr.
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)
- Loss Curves for Training HOT 2
- Trouble training ESRGAN with jpeg artifact images. HOT 2
- About test.yml HOT 5
- Why the dsgan's pretrained models can't uncompress? HOT 3
- Could I use the dsgan with my own image? HOT 4
- LR image generation HOT 2
- issue in DSGAN part about the UNsupervied training HOT 2
- didn't match because some of the arguments have invalid types: (list, keepdim=bool)
- _pickle.PicklingError: Can't pickle <function <lambda> at 0x7f308810e2f0>: attribute lookup <lambda> on __main__ failed
- WIll I need to retrain DSGAN for 2x SR? HOT 1
- There is no if __name__ == '__main__': in train.py
- RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1, 256, 1, 1]] is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck! HOT 15
- where are the options for testing? HOT 1
- ModuleNotFoundError: No module named 'PerceptualSimilarity' HOT 1
- Where is the source images Z for Discriminator?
- As for PerceptualSimilarity
- Pre-trained Models
- Files for DSGAN SDSR pretrained model broken HOT 1
- cannot import name 'models' from 'PerceptualSimilarity'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from real-world-sr.