Hi Tanishq,
Thank you very much for your response. The error happens in the long cell (4th code cell) with the full Diffusion loop in the begining of the notebook. It exactly happens when I try to move the image to cpu.
There is a line in the notebook which does that:
image = image.detach().cpu().permute(0, 2, 3, 1).numpy()
In order to debug, I split it into three cells and tried running themL
image = image.detach()
image = image.cpu() [Error happens in this cell]
image = image.permute(0, 2, 3, 1).numpy()
Here is the error message:
Here is the stack trace:
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_26668/851303587.py in <module>
----> 1 image = image.cpu()
When I tried running with environment variable CUDA_LAUNCH_BLOCKING=1
Then the error happens at
And the error message is RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_20699/2034803612.py in <module>
2 latents = 1 / 0.18215 * latents
3 with torch.no_grad():
----> 4 image = vae.decode(latents)
5 image = image.sample
/opt/conda/lib/python3.7/site-packages/diffusers/models/vae.py in decode(self, z, return_dict)
575 def decode(self, z: torch.FloatTensor, return_dict: bool = True) -> Union[DecoderOutput, torch.FloatTensor]:
576 z = self.post_quant_conv(z)
--> 577 dec = self.decoder(z)
578
579 if not return_dict:
/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1129 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130 return forward_call(*input, **kwargs)
1131 # Do not call functions when jit is used
1132 full_backward_hooks, non_full_backward_hooks = [], []
/opt/conda/lib/python3.7/site-packages/diffusers/models/vae.py in forward(self, z)
208 def forward(self, z):
209 sample = z
--> 210 sample = self.conv_in(sample)
211
212 # middle
/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1129 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130 return forward_call(*input, **kwargs)
1131 # Do not call functions when jit is used
1132 full_backward_hooks, non_full_backward_hooks = [], []
/opt/conda/lib/python3.7/site-packages/torch/nn/modules/conv.py in forward(self, input)
455
456 def forward(self, input: Tensor) -> Tensor:
--> 457 return self._conv_forward(input, self.weight, self.bias)
458
459 class Conv3d(_ConvNd):
/opt/conda/lib/python3.7/site-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
452 _pair(0), self.dilation, self.groups)
453 return F.conv2d(input, weight, bias, self.stride,
--> 454 self.padding, self.dilation, self.groups)
455
456 def forward(self, input: Tensor) -> Tensor:
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
Any advice would be extremely helpful @ilovescience Tanishq. Thank you