Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.13k stars 4.14k forks source link

请问argmax目前是不是只支持一维的 #2349

Open 2017ZYS opened 3 years ago

2017ZYS commented 3 years ago

对于crnn中pytorch中forward的这种写法:scores,preds = output.max(2),output是3个维度, onnx会转换成两个节点,其中argmax节点在转换ncnn模型时报错

nihui commented 1 month ago

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