ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Convert onnx to ncnn with python?

Open joeyballentine opened this issue 3 years ago • 7 comments
trafficstars

detail | 详细描述 | 詳細な説明

Hi,

Is there a way to convert an ONNX model to NCNN with python? I see no good examples anywhere on the internet and the onnx2ncnn from this repo is c++

My ultimate goal is to be able to pogrammaically convert pytorch models to ncnn, so using convertmodel.com is not something I can use as I want to do it through code

Do you have any suggestions?

Thank you

joeyballentine avatar Feb 08 '22 16:02 joeyballentine

use this https://convertmodel.com/

caishanli avatar Mar 11 '22 08:03 caishanli

As I stated previously, my goal is to be able to convert in python code. My end goal is to be able to have a user be able to select a pytorch model, and if they do not have an Nvidia GPU my code can just convert the model to ncnn automatically (through ONNX) and use that instead. I cannot do this if I have to make my users go to convertmodel.com.

joeyballentine avatar Mar 11 '22 11:03 joeyballentine

@joeyballentine Four months have passed, do u find the solution ?

Digital2Slave avatar Jul 28 '22 09:07 Digital2Slave

@joeyballentine Four months have passed, do u find the solution ?

Yes, the solution is we are rewriting the entirety of onnx2ncnn in python. It's still in progress.

joeyballentine avatar Jul 28 '22 13:07 joeyballentine

@joeyballentine Four months have passed, do u find the solution ?

Yes, the solution is we are rewriting the entirety of onnx2ncnn in python. It's still in progress.

:+1: Good luck! Is it possible to share the onnx2ncnn python script by create a PR in this repo?

Digital2Slave avatar Jul 29 '22 01:07 Digital2Slave

@joeyballentine Four months have passed, do u find the solution ?

Yes, the solution is we are rewriting the entirety of onnx2ncnn in python. It's still in progress.

:+1: Good luck! Is it possible to share the onnx2ncnn python script by create a PR in this repo?

That's up to @theflyingzamboni as he's the one doing all the work on it, but I think he's just going to put it in its own separate repo

joeyballentine avatar Jul 29 '22 01:07 joeyballentine

@joeyballentine Four months have passed, do u find the solution ?

Yes, the solution is we are rewriting the entirety of onnx2ncnn in python. It's still in progress.

+1 Good luck! Is it possible to share the onnx2ncnn python script by create a PR in this repo?

That's up to @theflyingzamboni as he's the one doing all the work on it, but I think he's just going to put it in its own separate repo

OK, Thanks!

Digital2Slave avatar Jul 29 '22 02:07 Digital2Slave