dylran / crowddiff

MIT License
92 stars 11 forks source link

An issue of type error when runing testing script #4

Closed ChyaZhang closed 10 months ago

ChyaZhang commented 1 year ago

Thank you for your work which has greatly inspired my research. I encountered the following issue while attempting to run the testing script:Traceback (most recent call last): File "super_res_sample.py", line 449, in <module> main() File "super_res_sample.py", line 95, in main samples = diffusion.p_sample_loop( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 499, in p_sample_loop for sample in self.p_sample_loop_progressive( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 597, in p_sample_loop_progressive out = self.p_sample( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 438, in p_sample out = self.p_mean_variance( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/respace.py", line 91, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 268, in p_mean_variance model_output = model(x, self._scale_timesteps(t), **model_kwargs) File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/respace.py", line 128, in __call__ new_ts = map_tensor[ts] IndexError: tensors used as indices must be long, byte or bool tensors

I have tried finding the reason. I find that the shape of ts is [0,3,256,256], which is supposed to be [1,3,256,256]. The line97 in super_res_sample.py, model_kwargs['low_res'].size(0) is 0, but the line436 in super_res_sample.py, I print the low_res.size(0) and find it is 1. I have no idea about this phenomenon

dylran commented 11 months ago

Thank you for bringing this to our attention. The current codebase was used in the ablations as well. I will check and fix this issue in near future.

RaccoonDML commented 9 months ago

I met the same issue in reproducing.

sainny commented 6 months ago

Thank you for your work which has greatly inspired my research. I encountered the following issue while attempting to run the testing script:Traceback (most recent call last): File "super_res_sample.py", line 449, in <module> main() File "super_res_sample.py", line 95, in main samples = diffusion.p_sample_loop( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 499, in p_sample_loop for sample in self.p_sample_loop_progressive( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 597, in p_sample_loop_progressive out = self.p_sample( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 438, in p_sample out = self.p_mean_variance( File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/respace.py", line 91, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/gaussian_diffusion.py", line 268, in p_mean_variance model_output = model(x, self._scale_timesteps(t), **model_kwargs) File "/home/zcy/CrowdCounting/DiffuseDenoiseCount-main/guided_diffusion/respace.py", line 128, in __call__ new_ts = map_tensor[ts] IndexError: tensors used as indices must be long, byte or bool tensors

I have tried finding the reason. I find that the shape of ts is [0,3,256,256], which is supposed to be [1,3,256,256]. The line97 in super_res_sample.py, model_kwargs['low_res'].size(0) is 0, but the line436 in super_res_sample.py, I print the low_res.size(0) and find it is 1. I have no idea about this phenomenon

May I ask if you have solved it? I am also facing the same problem

IceIce1ce commented 4 months ago

+1

MoetezKd commented 2 months ago

same problem here!