LingxiaoYang2023 / DSG2024

Official pytorch repository for “Guidance with Spherical Gaussian Constraint for Conditional Diffusion”
28 stars 2 forks source link

Something error in DSG Sample #2

Open MaoAYD opened 1 month ago

MaoAYD commented 1 month ago

I get an error when run the DGS_run.sh """ grad_norm = torch.linalg.norm(grad, dim=[1, 2, 3]) RuntimeError: linalg.norm: If dim is specified, it must be of length 1 or 2. Got [1, 2, 3] """

LingxiaoYang2023 commented 1 month ago

I did not encounter this problem, but it seems that the input format may not be correct. Please check the input size which is (1,c,h,w) instead of (c,h,w).

LingxiaoYang2023 commented 6 days ago

This issue might be associated with the version of PyTorch you are using. Please verify that you have PyTorch version 1.11.0+cu113 installed, as specified in the README. Alternatively, you may also calculate the gradient norm using _gradnorm = torch.linalg.norm(grad), which utilizes the default parameter of dim.