python中使用指定GPU import os os.environ["CUDA_VISIBLE_DEVICES"] = "2" # 或 os.environ["CUDA_VISIBLE_DEVICES"] = "0,2,3" (等号右边的双引号可以省略)