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

Error while running test.py #6

Open
kvuong2711 opened this issue Oct 30, 2024 · 0 comments
Open

Error while running test.py #6

kvuong2711 opened this issue Oct 30, 2024 · 0 comments

Comments

@kvuong2711
Copy link

kvuong2711 commented Oct 30, 2024

Hi authors,

Thanks for the great work. I'm running the evaluation script for zeronvs-finetune and running into some error in terms of shape. Do you know what could be happening here:

Command:

python test.py -e configs/zeronvs_finetune -r 90000 -s zeronvs_evaluation -b 1 -w 4 --save_generations True
Traceback (most recent call last):
  File "test.py", line 178, in <module>
    main()
  File "test.py", line 113, in main
    pred = img_logger.log_img(model, batch, resume, split='test', returngrid='train', warpeddepth=None, onlyretimg=True).permute(0,2,3,1) # from chw to hwc, in range -1,1
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/logger.py", line 124, in log_img
    images = model.log_images(batch, no_recon_cond=self.no_recon_cond, only_sample_output=self.only_sample_output, split=split, **self.log_images_kwargs)
  File "/home/kvuong/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddpm.py", line 1592, in log_images
    samples_cfg, _ = self.sample_log(cond=c, batch_size=N, ddim=use_ddim,
  File "/home/kvuong/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddpm.py", line 1445, in sample_log
    outs = ddim_sampler.sample(ddim_steps, batch_size,
  File "/home/kvuong/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddim.py", line 109, in sample
    outs = self.ddim_sampling(conditioning, size,
  File "/home/kvuong/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddim.py", line 168, in ddim_sampling
    outs = self.p_sample_ddim(img, cond, ts, index=index, use_original_steps=ddim_use_original_steps,
  File "/home/kvuong/miniconda3/envs/megascenes/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddim.py", line 215, in p_sample_ddim
    c_in[k] = [torch.cat([ unconditional_conditioning[k][i], c[k][i]]) for i in range(len(c[k]))]
  File "/home/kvuong/workspace/local/CVPR2025/nvs/ldm/models/diffusion/ddim.py", line 215, in <listcomp>
    c_in[k] = [torch.cat([ unconditional_conditioning[k][i], c[k][i]]) for i in range(len(c[k]))]
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 225 but got size 168 for tensor number 1 in the list.
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

1 participant