Comments (4)
Haven't had time to add this yet. Have to decide if I want to add this custom layer to each implementation or if I should add a common python file with custom layers. If you want to get rid of this message you can use this Upsample
module.
class Upsample(nn.Module):
""" nn.Upsample is deprecated """
def __init__(self, scale_factor, mode="nearest"):
super(Upsample, self).__init__()
self.scale_factor = scale_factor
self.mode = mode
def forward(self, x):
x = F.interpolate(x, scale_factor=self.scale_factor, mode=self.mode)
return x
from pytorch-gan.
Actually this is not an error, it's just a warning. You don't need to worry about it.
If you want, you can just change the torch.nn.Upsample()
layer for the function torch.nn.functional.interpolate()
and choose the same interpolation method to have same behavior, e.g., change torch.nn.Upsample(mode='nearest', scale_factor=2)(x_in)
to torch.nn.functional.interpolate(x_in, mode='nearest', scale_factor=2)
.
The problem is that nn.function.interpolate
does not have bicubic interpolation implementation. In this case I transform the tensor back to numpy array and use any existing implemantion for it (like the PIL.Image.resize), then transform it back to Tensor (not sure if it is intelligent, but does the trick). There is a nice dicussion about this change here.
from pytorch-gan.
Just like @alsombra said it's just a warning, so you can run the implementations without problems despite the message you got. That said, I will probably write a wrapper for torch.nn.functional.interpolate
soon which will replace the nn.Upsample
layers.
from pytorch-gan.
Thank you so much l got it.
from pytorch-gan.
Related Issues (20)
- plot gradient norm and weight clipping for each layer
- Gradient of a Discriminator in optimizing a Generator HOT 3
- when to save model for inference
- AAE in data augmentation
- buffer in the cyclegan HOT 1
- how test image on original size? (UNIT)
- Can I specify the number of images to be generated? HOT 1
- Query: DCGAN Saving Weights AND Parallelization
- Question about error for context encoder HOT 1
- Query: WGAN-GP FID SCORE (PyTorch) HOT 2
- Cannot download facades dataset for Pix2Pix HOT 4
- A little mistake in acgan HOT 1
- ESRGAN results HOT 2
- Quote GAN HOT 1
- clip_value in WGANGP not used
- ESRGAN datasets.py problem
- 我长期研究和改进GAN,如果对GAN或者深度学习感兴趣的可以联系我,联系方式,wechat: lovedaixiaobaby HOT 2
- Dataset Download Link was changed HOT 1
- Is it possible for the AI (GAN Generative Adversarial Network) to generate exploit codes (in this first version only python) automatically? SueGAN HOT 1
- How to draw the architecture diagram ?
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 pytorch-gan.