Why does TensorFlow always use GPU 0?

前端 未结 2 886
花落未央
花落未央 2021-02-19 04:07

I hit a problem when running TensorFlow inference on multiple-GPU setups.

Environment: Python 3.6.4; TensorFlow 1.8.0; Centos 7.3; 2 Nvidia Tesla P4

Her

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 04:52

    The device names might be different depending on your setup.

    Execute:

    from tensorflow.python.client import device_lib
    print(device_lib.list_local_devices())
    

    And try using the device name for your second GPU exactly as listed there.

提交回复
热议问题