Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to convert python model (pth) to ncnn (bin & param) model #59

Open
EKI-INDRADI opened this issue Dec 4, 2023 · 4 comments
Open

Comments

@EKI-INDRADI
Copy link

example model: https://github.com/xinntao/Real-ESRGAN/blob/master/docs/model_zoo.md

@zjx424
Copy link

zjx424 commented Jan 7, 2024

@Ohrwerk
Copy link

Ohrwerk commented Apr 22, 2024

Thanks for the HowTo with Chainer but no chainner version is running, i think my system is to old.

@NeedsMoar
Copy link

I tried the above a while ago and chainner was producing corrupted ncnn output that neither the newer version of torch the system python had installed, or the old ncnn executables, or anything else could open. Chainner ends up being a gigantic install that you don't need if you have torch installed literally anywhere else, I have scripts written for the rare upscaling I need already, and I have way too many python installs thanks to every open and closed source program on the planet installing its own full python copy.

I've always used this:
https://drive.google.com/file/d/1ibGyGgUP1oCpJ73y_3z471m50Qa6A2GB/view
You really just need the tools subdirectory and pth2ncnn.exe... extract those somewhere then run pth2ncnn on the .pth file. It can't convert some newer types of models but AFAICT it works on everything this version of realesrgan can use. If it work's you'll get a subdirectory named after the model with the bin and params

@Ohrwerk
Copy link

Ohrwerk commented Apr 26, 2024

Hello NeedsMoar,
thank you very much for sharing your tool and experiences.
Yes, it is similar with ffmpeg, although I cleaned it out some time ago, so I already have 10 times ffmpeg.exe on my disc again.
But unfortunately... yes I know, my system is completely outdated.
"ONNX Runtime supports Windows 10 and above, only"

I just can't cope with Linux, my system doesn't support 11, 10 would work as a snail but that doesn't make sense any more and I just don't like it for reasons. A new computer is a big investment, especially if you also want to switch to CUDA, and it doesn't match my philosophy either.
I could write novels here about why things are the way they are, but let's leave it at that. I also don't have anyone who would come round for dinner to help with problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants