Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value size reshape #17

Closed
zimingzhong opened this issue Jan 5, 2024 · 2 comments
Closed

Value size reshape #17

zimingzhong opened this issue Jan 5, 2024 · 2 comments

Comments

@zimingzhong
Copy link

zimingzhong commented Jan 5, 2024

When i run python launch.py --config custom/threestudio-3dgs/configs/gaussian_splatting.yaml --train --gpu 0 system.prompt_processor.prompt="a delicious hamburger"

https://github.com/threestudio-project/threestudio/blob/d85e1f8dfdcc1a8015fbedc6b9c213653a47c219/threestudio/models/guidance/stable_diffusion_guidance.py#L267-L270

alpha = self.alphas[t] ** 0.5
sigma = (1 - self.alphas[t]) ** 0.5
latents_denoised = (latents_noisy - sigma * noise_pred) / alpha
image_denoised = self.decode_latents(latents_denoised)

get error: latents denoise = (latents noisy - sigma * noise_pred) / alpha *** RuntimeError: The size of tensor a (4) must match the size of tensor b (64) at non-singleton dimension 3
i change it to
alpha = self.alphas[t] ** 0.5
alpha = alpha.view(-1, 1, 1, 1)
sigma = (1 - self.alphas[t]) ** 0.5
sigma = sigma.view(-1, 1, 1, 1)
latents_denoised = (latents_noisy - sigma * noise_pred) / alpha
image_denoised = self.decode_latents(latents_denoised)
then the code can run
is that right?

@DSaurus
Copy link
Owner

DSaurus commented Jan 5, 2024

Hi @zimingzhong ,

Thank you for pointing out this bug! I have fixed it in the latest commit.

@zimingzhong
Copy link
Author

zimingzhong commented Jan 5, 2024

Hi @zimingzhong ,

Thank you for pointing out this bug! I have fixed it in the latest commit.

Thank you for your quick reply. I provide a pull on threestudio. You can directly add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants