代码 import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_EDVICES"] = '1' #选择0,1的话是GPU,-1的话CPU