https://stackoverflow.com/questions/38009682/how-to-tell-if-tensorflow-is-using-gpu-acceleration-from-inside-python-shell
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
方法2
方法3
tensorflow查看使用的是cpu还是gpu
原文:https://www.cnblogs.com/sdu20112013/p/11556052.html