cuDNN error: CUDNN_STATUS_NOT_SUPPORTED. This error may appear if you passed in a non-contiguous input

Hi ! I’m training CNN and error comes up: “cuDNN error: CUDNN_STATUS_NOT_SUPPORTED. This error may appear if you passed in a non-contiguous input.”
I first used Tensor with shape (1,1,96,96,36) and the model worked well, but what data I need to input have the shape (1,1,512,512,336). I know that this error may happen because of the lack of GPU memory. But I checked “nvidia-smi” and the memory was enough to abundant.
I wonder whether there are any methods to solve this problem without changing firmware. Thanks in advance.

Could you post an executable code snippet as well as the output of python -m torch.utils.collect_env, please?

As a temporary solution you can use torch.backends.cudnn.enabled = False.