AmusementClub / vs-mlrt

Efficient CPU/GPU ML Runtimes for VapourSynth (with built-in support for waifu2x, DPIR, RealESRGANv2/v3, Real-CUGAN, RIFE, SCUNet and more!)
GNU General Public License v3.0
295 stars 20 forks source link

Tile error with Rife 4.26 on non standard dimension videos #112

Open zelenooki87 opened 1 week ago

zelenooki87 commented 1 week ago
Failed to evaluate the script:
Python exception: vsmlrt.RIFEMerge: tile size must be divisible by 64 (192, 160)

Traceback (most recent call last):
File "src\\cython\\vapoursynth.pyx", line 3365, in vapoursynth._vpy_evaluate
File "src\\cython\\vapoursynth.pyx", line 3366, in vapoursynth._vpy_evaluate
File "C:\Users\admin\AppData\Local\Temp\tempPreviewVapoursynthFile11_44_02_151.vpy", line 63, in 
clip = vsmlrt.RIFE(clip, multi=Fraction(2), model=426, backend=Backend.ORT_DML(fp16=False,device_id=0)) # new fps: 28.96
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:/Program Files/Hybrid/64bit/vs-mlrt/vsmlrt.py", line 1215, in RIFE
output0 = RIFEMerge(
^^^^^^^^^^
File "C:/Program Files/Hybrid/64bit/vs-mlrt/vsmlrt.py", line 1049, in RIFEMerge
raise ValueError(
ValueError: vsmlrt.RIFEMerge: tile size must be divisible by 64 (192, 160)

Latest Hybrid dev and vsmlrt addon. doe snot matter if I use Directml or TensorRT Input file dimensions are realy small Width : 176 pixels Height : 144 pixels

rife 4.25 and lower doesnt have this problem with such small input dimensions.

WolframRhodium commented 1 week ago

The exception is raised because rife 4.26 upgrades the architecture. (https://github.com/hzwer/Practical-RIFE/issues/109#issuecomment-2366812473)

You should not expect the limitation on tile size to be stable for the v1 implementation. The v2 implementation handles this automatically.

flowreen commented 1 week ago

@zelenooki87 In order to temporarily fix the following error: "Failed to evaluate the script: Python exception: vsmlrt.RIFEMerge: tile size must be divisible by 64" on the "v1" variants until the SVP developer updates their code, you can open C:\Program Files (x86)\SVP 4\script\generate.js and replace this:

    var pw = Math.floor((media.dst_w-1)/32+1)*32 - media.dst_w;
    var ph = Math.floor((media.dst_h-1)/32+1)*32 - media.dst_h;

with this:

    var pw = Math.floor((media.dst_w-1)/64+1)*64 - media.dst_w;
    var ph = Math.floor((media.dst_h-1)/64+1)*64 - media.dst_h;