ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Unsupported reduction axes !

Open Hassan-Recognito opened this issue 1 year ago • 2 comments

In pytorch

... norm = torch.norm(x, p=2) return x / norm

I converted this model into onnx and tried to convert to ncnn, got error "Unsupported reduction axes !" How to pass model conversion by modify pytorch script? Thanks.

Hassan-Recognito avatar Mar 07 '24 16:03 Hassan-Recognito

You can use pnnx to convert model instead of onnx. https://github.com/pnnx/pnnx

wzyforgit avatar Mar 08 '24 01:03 wzyforgit

针对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

nihui avatar Aug 05 '24 09:08 nihui