显存充足,但出现CUDA error:out of memory的错误解决
windows运行python报错如下
“Tried to allocate 2.56 GiB (GPU 0; 16.00 GiB total capacity; 443.41 MiB already allocated; 12.72 GiB free; 812.00 MiB reserved in total by PyTorch) If reserv ed memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF”
解决
试了网上的一些方法都仍然报这个错误,后来试着把config里的data_num_workers从4改成了0,就可以运行了。
我暂时也还不知道是什么原因,之前设置为4的时候是可以跑通的,今天再运行就出错了。