leftthomas / ESPCN

A PyTorch implementation of ESPCN based on CVPR 2016 paper "Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Real-time performance issue

wangqs97 opened this issue · comments

hi, I use the test_video.py to test the real-time videoSR performance of the model, when I test the 240P video it works just fine, but when it comes to 360P video, the fps reduced to 10.

I notice that the GPU utilization is only about 10%, but the CPU is at maximum capacity.

image = Variable(ToTensor()(y)).view(1, -1, y.size[1], y.size[0])
This line of code uses up most of CPU, and
out = out.cpu()
This line takes up most of the time. It takes 20ms to process while the model only takes 4ms. I thought it uses so much time because it needs to clean up the GPU ram, and I tried torch.cuda.empty_cache() before that and the time .cpu() consumed went down but the whole running time didn't change. I don't know how to tackle this problem, and I don't know what .cpu() does except copying data from GPU. I can really use some help. ( Or this is exactly how it works and I got nothing to do except using a better CPU?)

My CPU is i7-9700K and my GPU is RTX2080Ti. I also want to know the CPU you used for testing and the fps of the real-time VSR you can get.

Thanks in advance!!

@wqswqswswqs this can not be changed, this is a PyTorch design problem, so if you want to obtain a better fps, maybe you should contact the PyTorch designer.