Open NayamAmarshe opened 2 years ago
try pytorch2onnx.py --params
try pytorch2onnx.py --params
Doesn't work either.
Here's what I did, I changed the pytorch2onnx.py's line 14 from
model.load_state_dict(torch.load(args.input)[keyname])
to\
model.load_state_dict(torch.load(args.input), Strict=False)
and it worked and then I used https://convertmodel.com to get ncnn file from onnx.
BUT there's an issue, I do not know how to fix the param file. Would you happen to know about it?
I changed the first 2 lines where it said input.1
and I replaced input.1
with data
. At the end, I replaced 1895 with output
and then I used the executable to try the image upscaling, it works but the output is totally weird,
If you have any idea how to fix it, please let me know: bsrgan.param.txt
Use chaiNNer (https://github.com/JoeyBallentine/chaiNNer) to convert the pth file to onnx, then use https://convertmodel.com to convert the onnx to ncnn.
I also get the same error "KeyError: 'params'".I just want to convert RealESRGAN_x4plus.pth to onnx.
I also get the same error "KeyError: 'params'".I just want to convert RealESRGAN_x4plus.pth to onnx.
I used Chainner and it works great! Just import the model and convert it to onnx directly.
I also get the same error "KeyError: 'params'".I just want to convert RealESRGAN_x4plus.pth to onnx.
I used Chainner and it works great! Just import the model and convert it to onnx directly.
sorry to bother you , May I ask the speed you infer on ONNX model is better or worse than native pytorch model? Because in my case the inference speed of onnx model is even worse...
Chainner (Convert to Onnx)
Hi, I'm trying to convert BSRGAN model : https://drive.google.com/drive/folders/13kfr3qny7S2xwG9h7v95F5mkWs0OmU0D?usp=sharing and I also tried 4x_RRDB_ESRGAN.pth: https://drive.google.com/drive/folders/1O9qLq2CjywbS4FJXvJMggX8DjX4e-GAV
It's a pth file but I'm unable to convert it to ncnn. When I run the pytorch2onnx.py file and input the model it throws this error: