import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
一般装了gpu环境,默认就是用gpu跑模型
import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
一般装了gpu环境,默认就是用gpu跑模型