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

Tensor is not a torch image #26

Open
ArkasDev opened this issue Jun 8, 2022 · 0 comments
Open

Tensor is not a torch image #26

ArkasDev opened this issue Jun 8, 2022 · 0 comments

Comments

@ArkasDev
Copy link

ArkasDev commented Jun 8, 2022

During the execution I get the following error:

TypeError: tensor is not a torch image.

MacBook-Pro-3 clip-guided-diffusion % cgd --prompts "A mushroom in the style of Vincent Van Gogh" \ 
  --timestep_respacing 1000 \
  --init_image "images/32K_HUHD_Mushroom.png" \
  --init_scale 1000 \
  --skip_timesteps 350
Using device cpu. You can specify a device manually with `--device/-dev`
--wandb_project not specified. Skipping W&B integration.
Loading clip model	ViT-B/32	on device	cpu.
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
Downloading: "https://download.pytorch.org/models/vgg16-397923af.pth" to /Users/.cache/torch/hub/checkpoints/vgg16-397923af.pth
100%|███████████████████████████████████████████████████████████████████████████| 528M/528M [01:19<00:00, 6.96MB/s]
Loading model from: /Library/Python/3.8/site-packages/lpips-0.1.4-py3.8.egg/lpips/weights/v0.1/vgg.pth
  0%|                                                                                      | 0/650 [00:06<?, ?it/s]
Traceback (most recent call last):
  File "/usr/local/bin/cgd", line 33, in <module>
    sys.exit(load_entry_point('cgd-pytorch==0.2.5', 'console_scripts', 'cgd')())
  File "/Library/Python/3.8/site-packages/cgd_pytorch-0.2.5-py3.8.egg/cgd/cgd.py", line 357, in main
  File "/Library/Python/3.8/site-packages/cgd_pytorch-0.2.5-py3.8.egg/cgd/cgd.py", line 223, in clip_guided_diffusion
  File "/Users/Developement/dream-visual/clip-guided-diffusion/guided-diffusion/guided_diffusion/gaussian_diffusion.py", line 637, in p_sample_loop_progressive
    out = sample_fn(
  File "/Users/Developement/dream-visual/clip-guided-diffusion/guided-diffusion/guided_diffusion/gaussian_diffusion.py", line 522, in p_sample_with_grad
    out["mean"] = self.condition_mean_with_grad(
  File "/Users/Developement/dream-visual/clip-guided-diffusion/guided-diffusion/guided_diffusion/gaussian_diffusion.py", line 380, in condition_mean_with_grad
    gradient = cond_fn(x, t, p_mean_var, **model_kwargs)
  File "/Library/Python/3.8/site-packages/cgd_pytorch-0.2.5-py3.8.egg/cgd/cgd.py", line 150, in cond_fn
  File "/Library/Python/3.8/site-packages/torchvision-0.2.2.post3-py3.8.egg/torchvision/transforms/transforms.py", line 163, in __call__
    return F.normalize(tensor, self.mean, self.std, self.inplace)
  File "/Library/Python/3.8/site-packages/torchvision-0.2.2.post3-py3.8.egg/torchvision/transforms/functional.py", line 201, in normalize
    raise TypeError('tensor is not a torch image.')
TypeError: tensor is not a torch image.
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