realsr-ncnn-vulkan icon indicating copy to clipboard operation
realsr-ncnn-vulkan copied to clipboard

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

Open gmagic10 opened this issue 4 years ago • 7 comments

gmagic10 avatar Oct 08 '21 11:10 gmagic10

That same question :)

kodxana avatar Nov 28 '21 17:11 kodxana

pnnx

ArchieMeng avatar Feb 17 '22 16:02 ArchieMeng

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.

WubTheGame avatar Oct 27 '22 15:10 WubTheGame

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!

monday1313 avatar Oct 29 '22 23:10 monday1313

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.

WubTheGame avatar Oct 30 '22 03:10 WubTheGame

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'

JiSiN3000 avatar Nov 09 '22 15:11 JiSiN3000

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

WubTheGame avatar Nov 10 '22 17:11 WubTheGame