xxradon / PytorchToCaffe

Pytorch model to caffe model, supported pytorch 0.3, 0.3.1, 0.4, 0.4.1 ,1.0 , 1.0.1 , 1.2 ,1.3 .notice that only pytorch 1.1 have some bugs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A question about how to change scnn pytorch model to caffe model

snowflake119 opened this issue · comments

recently I research scnn model ,I have trained it with the pytorch ,now I am facing a question that I need to convert the pytorch model to caffe model ,I have tried the tools you recommend to me ,the scnn pytorch net link is :"https://github.com/harryhan618/SCNN_Pytorch "and the convert tool link is :"https://github.com/hahnyuan/nn_tools"
I use it to transform it ,the output error is like this:.....140674339123632:batch_norm_blob15 getting
relu15 was added to layers
140674339123704:relu_blob15 was added to blobs
Add blob relu_blob15 : torch.Size([1, 128, 36, 100])
140674339123704:relu_blob15 getting
:::x.shape::: torch.Size([1, 128, 36, 100])
conv16 was added to layers
140674339126368:conv_blob16 was added to blobs
Add blob conv_blob16 : torch.Size([1, 128, 1, 100])
Traceback (most recent call last):
File "example/scnn_pytorch_to_caffe.py", line 26, in
pytorch_to_caffe.trans_net(net,input,name)
File "./pytorch_to_caffe.py", line 716, in trans_net
out = net.forward(input_var)
File "./model.py", line 36, in forward
x = self.message_passing_forward(x)
File "./model.py", line 62, in message_passing_forward
x = self.message_passing_once(x, ms_conv, v, r)
File "./model.py", line 89, in message_passing_once
out.append(slices[i] + F.relu(conv(out[i - 1])))
The general meaning is when dealing with the slice operation error occors,can you help me to have a look at the question ,thank you