解决方法:在sh之前指定卡号 CUDA_VISIBLE_DEVICES=7 sh merge_sh.sh
watch -n 1 -d nvidia-smi 实时看卡的显存占用
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '7'写在文件的最前面
写在import torch前面
解决方法:在sh之前指定卡号 CUDA_VISIBLE_DEVICES=7 sh merge_sh.sh
watch -n 1 -d nvidia-smi 实时看卡的显存占用
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '7'写在文件的最前面
写在import torch前面