Skip to content

Error in 02-Pixel-Diffusion-colab.ipynb #10

Description

@yoloshoko
B=8 # number of samples
STEPS=200 # ddim steps

ddim_sampler=DDIM_Sampler(STEPS,model.model.num_timesteps)

model.cuda()
out=model(batch_size=B,sampler=ddim_sampler,shape=(64,64),verbose=True)

I encountered an error when running the code above. The error is as follows:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[12], [line 7](vscode-notebook-cell:?execution_count=12&line=7)
      4 ddim_sampler=DDIM_Sampler(STEPS,model.model.num_timesteps)
      6 model.cuda()
----> [7](vscode-notebook-cell:?execution_count=12&line=7) out=model(batch_size=B,sampler=ddim_sampler,shape=(64,64),verbose=True)

File f:\develop\anaconda\envs\py312-pytorch12\Lib\site-packages\torch\nn\modules\module.py:1736, in Module._wrapped_call_impl(self, *args, **kwargs)
   1734     return self._compiled_call_impl(*args, **kwargs)  # type: ignore[misc]
   1735 else:
-> [1736](file:///F:/develop/anaconda/envs/py312-pytorch12/Lib/site-packages/torch/nn/modules/module.py:1736)     return self._call_impl(*args, **kwargs)

File f:\develop\anaconda\envs\py312-pytorch12\Lib\site-packages\torch\nn\modules\module.py:1747, in Module._call_impl(self, *args, **kwargs)
   1742 # If we don't have any hooks, we want to skip the rest of the logic in
   1743 # this function, and just call forward.
   1744 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
   1745         or _global_backward_pre_hooks or _global_backward_hooks
   1746         or _global_forward_hooks or _global_forward_pre_hooks):
-> [1747](file:///F:/develop/anaconda/envs/py312-pytorch12/Lib/site-packages/torch/nn/modules/module.py:1747)     return forward_call(*args, **kwargs)
   1749 result = None
   1750 called_always_called_hooks = set()

File f:\develop\anaconda\envs\py312-pytorch12\Lib\site-packages\torch\utils\_contextlib.py:116, in context_decorator.<locals>.decorate_context(*args, **kwargs)
    113 @functools.wraps(func)
    114 def decorate_context(*args, **kwargs):
...
-> [1931](file:///F:/develop/anaconda/envs/py312-pytorch12/Lib/site-packages/torch/nn/modules/module.py:1931) raise AttributeError(
   1932     f"'{type(self).__name__}' object has no attribute '{name}'"
   1933 )

AttributeError: 'DDIM_Sampler' object has no attribute 'alphas_cumprod_prev_sqrt'
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?fa2cab4c-666a-42ae-839f-75132ed1ebf6) or open in a [text editor](command:workbench.action.openLargeOutput?fa2cab4c-666a-42ae-839f-75132ed1ebf6). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions