GPU/CPU选择 import os os.environ['CUDA_VISIBLE_DEVICES'] = "0,2" # 使用GPU/CPU (0-3为GPU,-1为CPU) # os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # CPU忽略警告