Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在遇到池化层的时候报错 #86

Open
ZZHHogan opened this issue Jul 1, 2020 · 2 comments
Open

在遇到池化层的时候报错 #86

ZZHHogan opened this issue Jul 1, 2020 · 2 comments

Comments

@ZZHHogan
Copy link

ZZHHogan commented Jul 1, 2020

cnn.conv3
conv: batch_norm_blob2
conv6 was added to layers
144541320:conv_blob6 was added to blobs
cnn.relu3
relu4 was added to layers
144541720:relu_blob4 was added to blobs
cnn.convproject3
conv: relu_blob4
conv7 was added to layers
144541560:conv_blob7 was added to blobs
cnn.pooling2
max_pool2 was added to layers
144541480:max_pool_blob2 was added to blobs
Traceback (most recent call last):
File "E:/pro/PytorchToCaffe-master/example/testConvert.py", line 229, in
pytorch_to_caffe.trans_net(net,input,name)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 789, in trans_net
out = net.forward(input_var)
File "E:/pro/PytorchToCaffe-master/example/testConvert.py", line 116, in forward
conv = self.cnn(input)
File "E:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "E:\anaconda\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "E:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "E:\anaconda\lib\site-packages\torch\nn\modules\pooling.py", line 146, in forward
self.return_indices)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 693, in call
out=self.obj(self.raw,*args,**kwargs)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 186, in _max_pool2d
_pool('max',raw,input, x, kernel_size, stride, padding,ceil_mode)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 170, in _pool
pad=padding, type=type.upper() , ceil_mode = ceil_mode)
File "E:\pro\PytorchToCaffe-master\Caffe\layer_param.py", line 117, in pool_param
pool_param.stride=pair_process(stride)
File "E:\pro\PytorchToCaffe-master\Caffe\layer_param.py", line 10, in pair_process
raise ValueError("number in item {} must be the same".format(item))
ValueError: number in item (2, 1) must be the same

@yanty123
Copy link

请问兄弟拟解决这个问题了吗,好像是这个avg要求输入图像的长宽一致

@yanzhou-li
Copy link

cnn.conv3
conv: batch_norm_blob2
conv6 was added to layers
144541320:conv_blob6 was added to blobs
cnn.relu3
relu4 was added to layers
144541720:relu_blob4 was added to blobs
cnn.convproject3
conv: relu_blob4
conv7 was added to layers
144541560:conv_blob7 was added to blobs
cnn.pooling2
max_pool2 was added to layers
144541480:max_pool_blob2 was added to blobs
Traceback (most recent call last):
File "E:/pro/PytorchToCaffe-master/example/testConvert.py", line 229, in
pytorch_to_caffe.trans_net(net,input,name)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 789, in trans_net
out = net.forward(input_var)
File "E:/pro/PytorchToCaffe-master/example/testConvert.py", line 116, in forward
conv = self.cnn(input)
File "E:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "E:\anaconda\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "E:\anaconda\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "E:\anaconda\lib\site-packages\torch\nn\modules\pooling.py", line 146, in forward
self.return_indices)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 693, in call
out=self.obj(self.raw,*args,**kwargs)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 186, in _max_pool2d
_pool('max',raw,input, x, kernel_size, stride, padding,ceil_mode)
File "E:\pro\PytorchToCaffe-master\pytorch_to_caffe.py", line 170, in _pool
pad=padding, type=type.upper() , ceil_mode = ceil_mode)
File "E:\pro\PytorchToCaffe-master\Caffe\layer_param.py", line 117, in pool_param
pool_param.stride=pair_process(stride)
File "E:\pro\PytorchToCaffe-master\Caffe\layer_param.py", line 10, in pair_process
raise ValueError("number in item {} must be the same".format(item))
ValueError: number in item (2, 1) must be the same

@hhhhhhogan @yanty123 ,Hi ,I also have met this problem.Have you solved the problem?Can you give me some advise. thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants