torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 27.21 GiB. GPU 0 has a total capacity of 31.37 GiB of which 20.98 GiB is free. Including non-PyTorch memory, this process has 10.38 GiB memory in use. Of the allocated memory 9.44 GiB is allocated by PyTorch, and 345.86 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
What parameters can be modified to reduce usage
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 27.21 GiB. GPU 0 has a total capacity of 31.37 GiB of which 20.98 GiB is free. Including non-PyTorch memory, this process has 10.38 GiB memory in use. Of the allocated memory 9.44 GiB is allocated by PyTorch, and 345.86 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
What parameters can be modified to reduce usage