SimDeblur icon indicating copy to clipboard operation
SimDeblur copied to clipboard

Unable to execute inference_image script

Open Aparajit-Garg opened this issue 2 years ago • 1 comments

Hi, Great repository, just loved it. I am trying to execute inference_image.py with the dbn architecture as the backbone but I'm getting stuck on this: Executing the script produces the following:

Cannot inport EDVR modules!!! Cannot import STFAN modules!!! Using checkpoint loaded from ./checkpoints/dbn_ckpt.pth for testing. Traceback (most recent call last): File "inference_image.py", line 81, in inference() File "inference_image.py", line 70, in inference outputs = arch.postprocess(arch.model(arch.preprocess(input_image))) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/content/drive/MyDrive/SimDeblur/simdeblur/model/backbone/dbn/dbn.py", line 137, in forward central_frame = x[:, self.num_frames // 2] IndexError: index 2 is out of bounds for dimension 1 with size 1

I tried printing the dimensions of the image and it came out to be: torch.Size([1, 1, 3, 385, 1504]) and self.num_frames is 5 for my case. Don't know how to resolve the issue. Please help out.

Aparajit-Garg avatar Mar 25 '22 07:03 Aparajit-Garg

Hi, note that EDVR and STFAN models are required to be compiled on the GPU platform, and the script "inference_image.py" is just responsible for single image deblurring models, e.g., SRN. If you want to infer a video, you can try the notebook on CoLab. Meanwhile, I will release "inference_video.py" for video deblurring models soon, please stay tuned!

ljzycmd avatar Mar 25 '22 07:03 ljzycmd