Real-ESRGAN icon indicating copy to clipboard operation
Real-ESRGAN copied to clipboard

Inference with ONNXRuntime

Open SeanLee97 opened this issue 2 years ago • 2 comments

  • refactor pytorch2onnx:
    • load hyperparameters from the specific configure file
    • use dynamic axes instead of fixed axes to support actual usage
  • add inference API with onnxruntime

SeanLee97 avatar Jun 13 '22 09:06 SeanLee97

why does the time onnx-model need to inference is more than the original pytorch model?

Fischer-pixel avatar Sep 12 '22 15:09 Fischer-pixel

我参考script文件夹中的pytorch2onnx.py,成功将RealESRGAN_x4plus这个模型转成onnx模型了,测试确实可以得到不错的效果。之后把scale=4修改成2,转换RealESRGAN_x2plus模型也成功。但转换RealESRGAN_x4plus_anime_6B模型却失败了,报错如下: RuntimeError: Error(s) in loading state_dict for RRDBNet: Missing key(s) in state_dict: "body.6.rdb1.conv1.weight", "body.6.rdb1.conv1.bias", "body.6.rdb1.conv2.weight", "body.6.rdb1.conv2.bias", "body.6.rdb1.conv3.weight", "body.6.rdb1.conv3.bias", "body.6.rdb1.conv4.wei。。。。。。(后面一堆这种提示,省略) | | |/ 请问要怎么修改才能将RealESRGAN_x4plus_anime_6B模型导出onnx模型成功呢?

lasifea avatar Nov 22 '23 08:11 lasifea