在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
]
>>>
>>>

 

 

 

 

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

相关文章:

  • 2021-06-20
  • 2021-06-10
  • 2021-07-26
  • 2021-12-03
  • 2021-09-18
  • 2021-10-18
  • 2021-09-27
  • 2022-01-07
猜你喜欢
  • 2021-10-18
  • 2022-01-01
  • 2021-12-08
  • 2022-12-23
  • 2021-05-02
  • 2021-04-02
相关资源
相似解决方案