os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ['CUDA_VISIBLE_DEVICES']= '0, 1' #用0和1号GPU os.environ["CUDA_VISIBLE_DEVICES"] = "3" #使用3号卡