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

'_sigmoid()' and '_tanh()' in pytorch_to_caffe.py #64

Open AppleAndBanana opened 4 years ago

AppleAndBanana commented 4 years ago

I found that the function '_sigmoid() ' and '_tanh()' in pytorch_to_caffe.py has no return. This will result in failure when my net has sigmoid or tanh module. Maybe is this a bug?

luameows commented 4 years ago

Trying to use nn.functional.sigmoid instead of nn.Sigmoid can solve this problem. However, the _tanh() still have some bugs, cause it will generate two output blobs like this. image The reson of this situation is pytorch_to_caffe.py has two duplicate function of F.tanh = Rp(F.tanh, _tanh). Comment one of them can solve the problem. image

Single430 commented 3 years ago

Mark,调试了半天,终于找到问题解决了!感谢感谢!!