Now that I have VapourSynth running and everything I tried to setup BasicVSR++. I think I've done the setup correctly, the only thing that remains is that PyTorch is running out of memory. I'm using a RTX 3070 8 GB. I haven't found anything on basicvsr pertaining to the memory configuration, how am I supposed to adjust for this error?
CUDA out of memory. Tried to allocate 6.59 GiB (GPU 0; 8.00 GiB total capacity; 7.24 GiB already allocated; 0 bytes free; 7.24 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
+ Reply to Thread
Results 1 to 10 of 10
I haven't found anything on basicvsr pertaining to the memory configuration, how am I supposed to adjust for this error?
Assuming you are, you can adjust the tile_..-settings:
tile_x: int = 0, tile_y: int = 0, tile_pad: int = 16,
Since model 3-5 requires the input resolution must be at least 256 and mod-4, you need to make sure every tile's width/height plus padding is also at least 256 and mod-4. When the source's width and height is not divisible by tile_x and tile_y respectively, the last tile's resolution could be less than 256. In your example, 2160 is not divisible by 480, 320 and 392, making the last tile's height 240 and 200. If you had tile_pad=16 set, then 240+16=256 would be fine, but not for the other case.
Note that using tiling, the whole process will get slower.
Alternatively, lower the resolution of your source.
Selurusers currently on my ignore list: deadrats, Stears555
Alright thank you. But source video is 1280x720, which is already mod4. I suppose it's already too much for this process. How do I find the best tiling setting for my hardware, any tips? Naturally I would use the input resolution div2, div4 etc. but do you know if it's better to use square tiles?
I would start with something like 320x360. haven't found any gain/loss form using square vs. non-square tile sizes.users currently on my ignore list: deadrats, Stears555
Thank you very much. Now I only need to figure out why vspipe isn't always working. While the preview of vsedit works, the encoding will sometimes simply fail with "vspipe invalid data when processing input". If I'm using mode 3 to 5 there's no such issue.
For me, if I can preview it, then vspipe works fine.
What does your script look like?
Are you using your gpu for something else, in parallel, that could cause issues? (like using a gpu based encoder that also used gpu based filtering?)
Are you running out of ram?
Might be some virus scanner runnin amok.users currently on my ignore list: deadrats, Stears555
I tried doing this so it would end up being 2160p
import vapoursynth as vs from vsbasicvsrpp import BasicVSRPP core = vs.core clip = core.ffms2.Source(source='r2.mp4') clip = core.resize.Spline36(clip, 960, 540) clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709") clip = BasicVSRPP(clip, tile_x=320, tile_y=360) clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709") clip.set_output()
Okay, script looks simple enough. As a side note: the tile height of 360 seems wrong. (my 320x360 suggestion was based on 1280x720)
Make sure that all vsedit instances and similar are closed, just loading a different source or closing the current source script might not free the vram.
Also try if it works, if you restrict set interval=1.users currently on my ignore list: deadrats, Stears555
How to install BasicVSR++ I am getting the following msg while installing it.
C:\Users\SACHIN>mim install "mmcv>=2.0.0"
'mim' is not recognized as an internal or external command,
operable program or batch file.