ljzycmd / SimDeblur

Simple framework for image and video deblurring, implemented by PyTorch
MIT License
313 stars 38 forks source link

python inference_image.py error #20

Open biter0088 opened 3 months ago

biter0088 commented 3 months ago
(simdeblur) xiu@xiu:~/Learning/SimDeblur$ python inference_image.py /home/xiu/Learning/SimDeblur/configs/dbn/dbn_dvd.yaml  /home/xiu/Learning/SimDeblur/downloads_my/CKPT_PATH/dbn_ckpt.pth  --img=/home/xiu/Learning/datasets/video/videos/1/0001/input/0001.jpg  --save_path=/home/xiu/Learning/datasets/video/videos/1/0001/input/0001_deblur 
Cannot inport EDVR modules!!!
Cannot import STFAN modules!!!
Using checkpoint loaded from /home/xiu/Learning/SimDeblur/downloads_my/CKPT_PATH/dbn_ckpt.pth for testing.
Traceback (most recent call last):
  File "inference_image.py", line 81, in <module>
    inference()
  File "inference_image.py", line 70, in inference
    outputs = arch.postprocess(arch.model(arch.preprocess(input_image)))
  File "/home/xiu/anaconda3/envs/simdeblur/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/xiu/Learning/SimDeblur/simdeblur/model/backbone/dbn/dbn.py", line 135, in forward
    central_frame = x[:, self.num_frames // 2]
IndexError: index 2 is out of bounds for dimension 1 with size 1

And I download the dbn_ckpt.pth from your link.

ljzycmd commented 3 months ago

Hi @biter0088, note that inference_image.py is only for image models like SRN, yet DBN is a video deblurring model.