在anaconda中查看某个环境中的tensorflow是cpu还是gpu

在anaconda中查看某个环境中的tensorflow是cpu还是gpu

 

>>> import os
>>> from tensorflow.python.client import device_lib
>>> os.environ["TF_CPP_MIN_LOG_LEVEL"] = "99"
>>>
>>> print(device_lib.list_local_devices())
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 5425529995648658955
]
>>>
>>>

 

 

 

 

#############

posted @ 2021-04-18 20:52  西北逍遥  阅读(685)  评论(0编辑  收藏  举报