Comments (6)
and same other problems in trainSketchModule.py
from shapematchinggan.
class myBlur(nn.Module):
def init(self, kernel_size=121, channels=3):
super(myBlur, self).init()
self.kernel_size=kernel_size
self.channels = channels
self.GF = nn.Conv2d(in_channels=channels, out_channels=channels,
kernel_size=kernel_size, groups=channels, bias=False)
x_cord = torch.arange(self.kernel_size+0.)
x_grid = x_cord.repeat(self.kernel_size).view(self.kernel_size, self.kernel_size)
y_grid = x_grid.t()
self.xy_grid = torch.stack([x_grid, y_grid], dim=-1)
self.mean = (self.kernel_size - 1)/2 ###this may become float and cause pad error
self.diff = -torch.sum((self.xy_grid - self.mean)**2., dim=-1)
self.gaussian_filter = nn.Conv2d(in_channels=self.channels, out_channels=self.channels,
kernel_size=self.kernel_size, groups=self.channels, bias=False)
self.gaussian_filter.weight.requires_grad = False
from shapematchinggan.
The float bugs have been fixed.
It seems that your default data type is float?
In my case, the result of integer / integer is sill an integer.
e.g. (self.kernel_size - 1)/2 and trainnum/batchsize*batchsize
So there is no type error reported in the orginal code on my computer.
from shapematchinggan.
看来是我的问题。 不过都是python3 ,为什么我的整数相除会变成浮点?
from shapematchinggan.
It seems that I find the reason.
My code is implemented under python2, where integer / integer yields integer.
And in python3, integer / integer produces float.
from shapematchinggan.
so haven't you thought about making a python3 version?
from shapematchinggan.
Related Issues (20)
- about other style image training HOT 3
- can you provide a javascript veision ?please
- run HOT 1
- error with trainStructureTransfer.py HOT 10
- higher resolution HOT 3
- Image Matting HOT 7
- RuntimeError: The size of tensor a (256) must match the size of tensor b (254) at non-singleton dimension 1 HOT 1
- could the network generalize to the unseen style
- What license do you have? HOT 2
- about training HOT 3
- RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 HOT 1
- One model for one style? HOT 4
- Can the Background become Transparent to merge with other images? HOT 2
- Testing with multiple scales in [0,n] HOT 1
- about testing multiple images HOT 1
- The stylization of a string HOT 2
- why training for 3 steps? HOT 4
- Is distance-based process necessary? HOT 2
- balloon special effects HOT 1
- question about label smoothing HOT 4
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 shapematchinggan.