htshinichi / caffe-onnx

caffe model convert to onnx model
MIT License
175 stars 43 forks source link

fixed params bug in PReLU #34

Open LitLeo opened 2 years ago

LitLeo commented 2 years ago

解决了PReLU层 slope参数的维度转换错误。 对应的issue:https://github.com/htshinichi/caffe-onnx/issues/21 pytorch 转 onnx 之前也有这个错误,fixed详见 https://github.com/pytorch/pytorch/pull/21330

原先只支持PReLU层的输入维度为固定4维,即将slope的维度设置为[dim, 1, 1] 修改后,支持输入为变化维度。

修改思路为在修改param shape时,将input_shape作为参数输入,并根据input_shape决定slope的维度。