linux判断安装的tensorflow是gpu还是cpu版本 |
您所在的位置:网站首页 › linux如何查看tensorflow版本 › linux判断安装的tensorflow是gpu还是cpu版本 |
判断代码: import os from tensorflow.python.client import device_lib os.environ["TF_CPP_MIN_LOG_LEVEL"] = "99" if __name__ == "__main__": print(device_lib.list_local_devices())结果一:CPU [name: "/device:CPU:0" device_type: "CPU" memory_limit: 268435456 locality { } incarnation: 4723458630420161305 , name: "/device:XLA_CPU:0" device_type: "XLA_CPU" memory_limit: 17179869184 locality { } incarnation: 11640713468301226911 physical_device_desc: "device: XLA_CPU device" ]
结果二:GPU [name: "/device:CPU:0" device_type: "CPU" memory_limit: 268435456 locality { } incarnation: 17503920527771229331 , name: "/device:GPU:0" device_type: "GPU" memory_limit: 191365120 locality { bus_id: 1 links { link { device_id: 1 type: "StreamExecutor" strength: 1 } } } incarnation: 11078361316836643347 physical_device_desc: "device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:03:00.0, compute capability: 6.1" , name: "/device:GPU:1" device_type: "GPU" memory_limit: 6526258381 locality { bus_id: 1 links { link { type: "StreamExecutor" strength: 1 } } } incarnation: 15928025279328008063 physical_device_desc: "device: 1, name: GeForce GTX 1080 Ti, pci bus id: 0000:04:00.0, compute capability: 6.1" ] |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |