suhoy901 / capsulenetwork Goto Github PK
View Code? Open in Web Editor NEWpytorch, CapsNet
pytorch, CapsNet
RuntimeError Traceback (most recent call last)
in
28 engine.hooks['on_end_epoch'] = on_end_epoch
29
---> 30 engine.train(processor, get_iterator(True), maxepoch=NUM_EPOCHS, optimizer=optimizer)
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torchnet\engine\engine.py in train(self, network, iterator, maxepoch, optimizer)
61
62 state['optimizer'].zero_grad()
---> 63 state['optimizer'].step(closure)
64 self.hook('on_update', state)
65 state['t'] += 1
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torch\optim\adam.py in step(self, closure)
56 loss = None
57 if closure is not None:
---> 58 loss = closure()
59
60 for group in self.param_groups:
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torchnet\engine\engine.py in closure()
50
51 def closure():
---> 52 loss, output = state'network'
53 state['output'] = output
54 state['loss'] = loss
in processor(sample)
16 classes, reconstructions = model(data)
17
---> 18 loss = capsule_loss(data, labels, classes, reconstructions)
19 return loss, classes
20
E:\DeepLearning\envs\tensorflow_gpuenv\lib\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)
in forward(self, images, labels, classes, reconstrunctions)
14 #images = images.view(reconstructions.size()[0], -1)
15
---> 16 reconstrunction_loss = self.reconstrunction_loss(reconstrunctions, images)
17
18 return (margin_loss + 0.0005 * reconstrunction_loss) / images.size(0)
E:\DeepLearning\envs\tensorflow_gpuenv\lib\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)
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torch\nn\modules\loss.py in forward(self, input, target)
429
430 def forward(self, input, target):
--> 431 return F.mse_loss(input, target, reduction=self.reduction)
432
433
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torch\nn\functional.py in mse_loss(input, target, size_average, reduce, reduction)
2213 ret = torch.mean(ret) if reduction == 'mean' else torch.sum(ret)
2214 else:
-> 2215 expanded_input, expanded_target = torch.broadcast_tensors(input, target)
2216 ret = torch._C._nn.mse_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction))
2217 return ret
E:\DeepLearning\envs\tensorflow_gpuenv\lib\site-packages\torch\functional.py in broadcast_tensors(*tensors)
50 [0, 1, 2]])
51 """
---> 52 return torch._C._VariableFunctions.broadcast_tensors(tensors)
53
54
RuntimeError: The size of tensor a (784) must match the size of tensor b (28) at non-singleton dimension 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.