confnets's People
confnets's Issues
Possible problem with layers.basic.Upsample default align_corners kwarg.
import confnets
model = confnets.UNet3d(depth=3, in_channels=1, out_channels=1, fmaps=[5,5,5,5])
Gave me the following error:
ValueError Traceback (most recent call last)
in
----> 1 model = confnets.UNet3d(depth=3, in_channels=1, out_channels=1, fmaps=[5,5,5,5])
~/anaconda3/lib/python3.7/site-packages/confnets/models/unet.py in init(self, conv_type, **super_kwargs)
285 def init(self, conv_type='Conv3d', **super_kwargs):
286 super_kwargs['conv_type'] = conv_type
--> 287 super(UNet3d, self).init(dim=3, **super_kwargs)
288
289
~/anaconda3/lib/python3.7/site-packages/confnets/models/unet.py in init(self, dim, scale_factor, conv_type, norm_type, activation, final_activation, upsampling_mode, skip_factor, *super_args, **super_kwargs)
224 with torch.no_grad():
225 inp = torch.zeros((2, self.in_channels, *self.divisibility_constraint), dtype=torch.float32)
--> 226 self(inp)
227
228 # delete attributes that are only relevant for construction and might lead to errors when model is saved
~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
--> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)
~/anaconda3/lib/python3.7/site-packages/confnets/models/unet.py in forward(self, input_)
273 f'Input shape {input_.shape[2:]} not suited for downsampling with factors {self.scale_factors}.'
274 f'Lengths of spatial axes must be multiples of {self.divisibility_constraint}.'
--> 275 return super(UNet, self).forward(input_)
276
277
~/anaconda3/lib/python3.7/site-packages/confnets/models/unet.py in forward(self, input)
48 for encoded_state, upsample, skip, merge, decode in reversed(list(zip(
49 encoded_states, self.upsampling_modules, self.skip_modules, self.merge_modules, self.decoder_modules))):
---> 50 current = upsample(current)
51 encoded_state = skip(encoded_state)
52 current = merge(current, encoded_state)
~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
--> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)
~/anaconda3/lib/python3.7/site-packages/confnets/layers/basic.py in forward(self, input)
71
72 def forward(self, input):
---> 73 return nn.functional.interpolate(input, scale_factor=self.scale_factor, mode=self.mode, align_corners=False)
~/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py in interpolate(input, size, scale_factor, mode, align_corners)
2497 if mode in ('nearest', 'area'):
2498 if align_corners is not None:
-> 2499 raise ValueError("align_corners option can only be set with the "
2500 "interpolating modes: linear | bilinear | bicubic | trilinear")
2501 else:
ValueError: align_corners option can only be set with the interpolating modes: linear | bilinear | bicubic | trilinear
Changed layers.basic.Upsample, in forward, the parameter align_corners to None to avoid the error.
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.