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
MIT License
783 stars 224 forks source link

虽然view()有转换函数,但还是会报错 keyerror,请问是不是哪儿需要修改一下? #43

Open workingBird926 opened 5 years ago

yutian11308023 commented 5 years ago

I meet the same problem when I convert the Flatten layer, it comes into the view() function, but it gets fail. How to fix it?

yutian11308023 commented 5 years ago

I have fixed this problem. Because the error I encountered was due to the difference between the input of flatten and the x returned by the previous layer. I modified the code of the Flatten function in my model definition, keeping the value of the output of the Flatten function and the value of the output of the previous layer unchanged, and then calling view(). Finally, I can successfully solve the problem and convert the successful model.

dreamhighchina commented 5 years ago

大佬你是什么原因?我的也是这个keyerror add_blobs(self, blobs,name='blob',with_num=True): def get_blobs(self, var): var和blobs的id号不对应,这是怎么回事?

dreamhighchina commented 4 years ago

大佬是啥原因

yutian11308023 commented 4 years ago

@dreamhighchina ,I'm not sure I am the same problem as you, because I fixed the problem by modifying the code in my own model definition file. I went to track the return value x of the previous layer, found the change in the code of my model definition file and modified it, so that it is passed to the input value of the view() "input" which is same with the return "x" of the previous output. I hope it is helpful to you.

dreamhighchina commented 4 years ago

可以发个中文?

钱文明

邮箱:18655197870@163.com |

签名由 网易邮箱大师 定制

在2019年10月21日 10:48,yutian11308023 写道:

@dreamhighchina ,I'm not sure I am the same problem as you, because I fixed the problem by modifying the code in my own model definition file. I went to track the return value x of the previous layer, found the change in the code of my model definition file and modified it, so that it is passed to the input value of the view() "input" which is same with the return "x" of the previous output. I hope it is helpful to you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

xxradon commented 4 years ago

针对于view函数,请务必不要使用-1这个参数,请自行推断出view的具体输入参数。