如题:Ubuntu-Tensorflow ,程序被手动强行结束后(win+c),程序所占用的GPU的显存没有被释放掉,影响下次运行,会出现以下错误:
failed to allocate 4.75G (5102921216 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
解决方法:
方法1)终端上:sudo kill -9 PID
方法2)笨办法:重启电脑
方法3)fuser -v /dev/nvidia*
备注:动态显示GPU占用情况,在终端使用命令:
watch -n 1 nvidia-smi
更多细节:https://blog.csdn.net/lien0906/article/details/79296024
https://blog.csdn.net/lgh0824/article/details/77096241/
https://blog.csdn.net/u013548568/article/details/80297651