报错1
RuntimeError: CUDA out of memory. Tried to allocate 260.00 MiB (GPU 0; 31.72 GiB total capacity; 30.05 GiB already allocated; 187.88 MiB free; 30.31 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
原因:GPU已经使用太多,没办法分配更多空间。可能是模型太大或者load了太多数据到GPU。
解决:减小batch_size大小,使得每次载入GPU的数量小一些。
报错2
“shell1.sh: line 219: 16952 Killed CUDA_VISIBLE_DEVICES=${gpu_list} python main.py”
原因:如果该进程不是被手动kill掉的,那应该就是内存资源不够导致系统kill掉了进程。
解决:减小数据集大小,或者切分特征后按需读取用完释放,或者干脆对不需要存储的数据即时计算。