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

没有添加F.tanh=Rp(F.tanh,_tanh)?但是添加进去也没有转换? #40

Open DJinsis opened 5 years ago

DJinsis commented 5 years ago

你好,作者,我看你的代码没有添加F.tanh=Rp(F.tanh,_tanh),但是我自己添加进去,还是不能实现转换,是什么问题呢?

DJinsis commented 5 years ago

@xxradon 是我添加不对吗?还是有其他注册操作 image

xxradon commented 5 years ago

我已经更新了tanh的转换,你可以试试。

DJinsis commented 5 years ago

早上我修改了一下,我建了一个简单的网络,如下,包含Conv2d,relu,以及Tanh image 但是我跑了转换模型。转换后的结果如下,还是没有转换出tanh image 会不会是caffe代码里面的调用引起的? image

@xxradon

ischihmo commented 4 years ago

@DJinsis 请问大佬后来找到解决方案了吗,我发现sigmoid也有同样的问题

luameows commented 4 years ago

Trying to use nn.functional.sigmoid instead of nn.Sigmoid can solve this problem. https://github.com/xxradon/PytorchToCaffe/issues/64#issuecomment-664943926