缓存不够!!!!并非内存容量不够
错误提示: torch.cuda.0utofMemoryError: CUDA out of memory.Tried to allocate 2.00 MiB (PU 0; 23.69 GiB total capacity; 237 BiB already allocated; 18.38 MiB fre; 2.50 GiB reserved in total by PyTorch) 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
通过查资料,说内存不够用,换个好显卡,可但是通过运行指示nvidia-smi
发现在执行程序时仅使用极少的内存(图片-1%),因此不是内存不足,考虑可能是缓存爆了!