ayumiymk / ORN.pytorch1.0

Reconstruct ORN for pytorch1.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run demo.py

BADBADBADBOY opened this issue · comments

run demo.py

Traceback (most recent call last):
File "demo.py", line 100, in
model = Net(args.use_arf, args.orientation)
File "demo.py", line 74, in init
self.conv1 = ORConv2d(1, 10, arf_config=(1,nOrientation), kernel_size=3)
File "/src/notebooks/ORN/modules/ORConv.py", line 26, in init
self.bias.data.resize(out_channels*self.nRotation)
File "/opt/conda/lib/python3.6/site-packages/torch/tensor.py", line 341, in resize
return Resize.apply(self, sizes)
File "/opt/conda/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py", line 37, in forward
'x'.join(map(str, tensor.size())), tensor.numel()))
RuntimeError: requested resize to 80 (80 elements in total), but the given tensor has a size of 10 (10 elements). autograd's resize can only change the shape of a given tensor, while preserving the number of elements.

Traceback (most recent call last):
File "demo.py", line 100, in
model = Net(args.use_arf, args.orientation)
File "demo.py", line 74, in init
self.conv1 = ORConv2d(1, 10, arf_config=(1,nOrientation), kernel_size=3)
File "/src/notebooks/ORN/modules/ORConv.py", line 26, in init
self.bias.data.resize(out_channels*self.nRotation)
File "/opt/conda/lib/python3.6/site-packages/torch/tensor.py", line 341, in resize
return Resize.apply(self, sizes)
File "/opt/conda/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py", line 37, in forward
'x'.join(map(str, tensor.size())), tensor.numel()))
RuntimeError: requested resize to 80 (80 elements in total), but the given tensor has a size of 10 (10 elements). autograd's resize can only change the shape of a given tensor, while preserving the number of elements.

Hello, did you solve this problem?

RuntimeError: requested resize to 80 (80 elements in total), but the given tensor has a size of 10 (10 elements). autograd's resize can only change the shape of a given tensor, while preserving the number of elements.

Hello, I also encountered this problem when using pytorch1.1 and even higher version. Did you solve the problem?