ltkong218 / IFRNet

IFRNet: Intermediate Feature Refine Network for Efficient Frame Interpolation (CVPR 2022)
MIT License
259 stars 23 forks source link

Need to convert to onnx or torchscript model #3

Open Baiyuetribe opened 2 years ago

Baiyuetribe commented 2 years ago

The project is awesome, one of the few projects that can run demos properly,Request to add conversion methods for onnx

styler00dollar commented 2 years ago

grid_sample is supported in onnx opset 16, which you can currently only have if you compile pytorch. Pytorch 1.11 can only do up to opset 15. It will be available in the next pytorch release. Even when I removed grid_sample I enountered problems in exporting to onnx though.

ltkong218 commented 2 years ago

Welcome anyone to contribute to this project, including conversion methods for onnx. I will also consider this conversion later.

styler00dollar commented 2 years ago

Exporting to onnx with opset 16 seems to work if I comment out these lines:

        #img0_ = resize(img0, scale_factor=scale_factor)
        #img1_ = resize(img1, scale_factor=scale_factor)

        #up_flow0_1 = resize(up_flow0_1, scale_factor=(1.0/scale_factor)) * (1.0/scale_factor)
        #up_flow1_1 = resize(up_flow1_1, scale_factor=(1.0/scale_factor)) * (1.0/scale_factor)
        #up_mask_1 = resize(up_mask_1, scale_factor=(1.0/scale_factor))
        #up_res_1 = resize(up_res_1, scale_factor=(1.0/scale_factor))

The error seems to be related to the resize function.

image

eisneim commented 1 year ago

@styler00dollar does export onnx work in 2023?