# 指定使用第一个GPU进行计算 physical_devices = tf.config.experimental.list_physical_devices('GPU') if physical_devices: tf.config.experimental.set_visible_devices(physical_devices[0], 'GPU') logical_devices = tf.config.experimental.list_logical_devices('GPU') print(len(physical_devices), "Physi...