ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Feat/npy: pnnx添加 input=a.npy,b.npy 参数,支持从npy文件获取输入tensor的shape和内容,用于pnnx后续的推理优化 难度:普通

Open lovedream-ms opened this issue 7 months ago • 3 comments

feat():add input=a.npy, b. npy parameters to pnnx

pnnx添加 input=a.npy,b.npy 参数,支持从npy文件获取输入tensor的shape和内容,用于pnnx后续的推理优化 修改pnnx_graph.python和pnnx::save_ncnn函数使得生成的文件可以使用指定的npy eg:.pnnx model.pt input_npy_paths=ones.npy,ones.npy

build():add dependencies using source code

为了pnnx添加解析npy文件的参数,使用源代码的方式引入依赖 https://github.com/rogersce/cnpy/tree/4e8810b 在CMake中添加zlib依赖 在src/cmake中链接zlib

lovedream-ms avatar Aug 03 '25 04:08 lovedream-ms

CLA assistant check
All committers have signed the CLA.

tencent-adm avatar Aug 03 '25 04:08 tencent-adm

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15643128 15643128 0 :kissing_heart:
armhf 6648220 6648220 0 :kissing_heart:
aarch64 9986896 9986896 0 :kissing_heart:

github-actions[bot] avatar Aug 03 '25 05:08 github-actions[bot]

感谢你的工作,请将你在实现中的笔记和心得,遇到的困难和解决方法等,记录成文章,发表在discussion分区,这将作为知识总结 https://github.com/Tencent/ncnn/discussions

Thank you for your work. Please record your notes and experience in the implementation, difficulties encountered and solutions, etc. into an article and publish it in the discussion section. This will serve as a knowledge summary. https://github.com/Tencent/ncnn/discussions

nihui avatar Aug 21 '25 07:08 nihui