Closed Arctanxy closed 4 years ago
relu6 用 clip 实现
relu6 用 clip 实现 好哒,谢谢
针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn
pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]
详细参考文档 Detailed reference documentation https://github.com/pnnx/pnnx https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx
PyTorch提供的MobileNetv2使用了ReLU6这个激活函数,是使用hardtanh实现的,为了转成onnx,我用ReLU改写了一下ReLU6,写成了下面这种形式:
转化成ONNX之后,使用Netron打开是下面的形式:
但是转成ncnn之后,形式就乱了:
而param文件的内容如下:
想问下为何会出现这种情况?
我的环境: Pytorch:1.4 onnx:1.6 ncnn:2020年3月26日下载的最新源码