Oliiveralien / MDMS

Multi-Domain Multi-Scale Diffusion Model for Low-Light Image Enhancement (AAAI'24)
23 stars 0 forks source link

测试报错 #2

Closed hejh8 closed 7 months ago

hejh8 commented 7 months ago

Traceback (most recent call last): File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/eval_diffusion.py", line 83, in main() File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/eval_diffusion.py", line 79, in main model.restore(val_loader, validation=args.test_set, r=args.grid_r,use_align=True) File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/models/restoration.py", line 39, in restore x_output1 = self.diffusive_restoration(x_cond, r=r,fullresolusion=False) File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/models/restoration.py", line 80, in diffusive_restoration x_output = self.diffusion.sample_image(x_cond, x, ii,jj,osize,patch_locs=corners, patch_size=p_size,patch_locs1=corners1,patch_locs2=corners2) File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/models/ddm.py", line 222, in sample_image xs = utils.sampling.generalized_steps_overlapping(x, x_cond, seq, self.model, self.betas, ii=ii, jj=jj, File "/home/ubuntu/Low-image/duibi/Low-Light/MDMS-main/utils/sampling.py", line 99, in generalized_steps_overlapping et_output[0, :, hi:hi + p_size, wi:wi + p_size] += outputs[idx] IndexError: index 32 is out of bounds for dimension 0 with size 32

skkkyup commented 7 months ago

The idx here should be 64, representing the manually set batch size. It seems you have modified the patch-size and stride. The patch-size should be an integer multiple of the stride. Specific settings can be seen in lines 63 to 69 in '/models/restoration.py' .