If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
[해결 방법]
다음과 유사한 방식으로 환경 변수 설정
Windows: set 'PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512' Linux: export 'PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512'