Real-ESRGAN
Real-ESRGAN copied to clipboard
Inference with ONNXRuntime
- 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
why does the time onnx-model need to inference is more than the original pytorch model?
我参考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模型成功呢?