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 do you convert .pth model to .bin and .param model file? #31

Open
gmagic10 opened this issue Oct 8, 2021 · 7 comments
Open

how do you convert .pth model to .bin and .param model file? #31

gmagic10 opened this issue Oct 8, 2021 · 7 comments

Comments

@gmagic10
Copy link

gmagic10 commented Oct 8, 2021

No description provided.

@kodxana
Copy link

kodxana commented Nov 28, 2021

That same question :)

@ArchieMeng
Copy link
Contributor

pnnx

@WubTheGame
Copy link

If you want a much simpler solution (Literally drag and drop), you can download Cupscale, and:
1: Navigate in your Cupscale directory to CupscaleData\bin\pth2ncnn
2: Place your .pth model into the folder with the pth2ncnn.exe, and then drag that model onto the executable. A CMD will open and begin converting the model into a bin and param file for use with NCNN executables. Your files will be placed in a subfolder with the name of the file you converted, though you'll want to rename the converted files back to the original.

Hope this helps.

@monday1313
Copy link

I tried the pth2ncnn.exe . It opens the CMD window for a split second then closes it, but no files are written. I'm on a Mac running windows 10 on Parallels... It has full disk access... any idea what's happening? Thanks!

@WubTheGame
Copy link

I tried the pth2ncnn.exe . It opens the CMD window for a split second then closes it, but no files are written. I'm on a Mac running windows 10 on Parallels... It has full disk access... any idea what's happening? Thanks!

I have no idea. Can you get an idea of what the CMD is saying? That's the only way I know could help.

@JiSiN3000
Copy link

i tried it too with pth2ncnn.exe and a model (.pth) drag-n-drop.
the message is only for a split second visible on CMD.

The Message looks something like that:

Loading model
Traceback (most recent call last):
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 193, in run_module_as_main
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 85, in run_code
File "D:\Temp\Real-ESRGAN\Temp\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn\pth2ncnn.exe_main
.py~", line 440, in
File "D:\Temp\Real-ESRGAN\Temp\Cupscale 1.39.0f1\CupscaleData\bin\pth2ncnn\pth2ncnn.exe_main
.py~", line 361, in main
KeyError: 'model.0.weight'

@WubTheGame
Copy link

Okay, well, I'd say post about it on Cupscale's repo. I doubt it's of use here.

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

6 participants