Ask Your Question
1

What is the process to retrieve the currently available GPUs in tensorflow?

asked 2023-05-11 23:04:42 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-11 23:15:02 +0000

david gravatar image

To retrieve the currently available GPUs in TensorFlow, you can use the tf.config.list_physical_devices('GPU') function. The code to retrieve the available GPUs is as follows:

import tensorflow as tf

gpus = tf.config.list_physical_devices('GPU')
print("Number of GPUs available: ", len(gpus))
for gpu in gpus:
    print("GPU Name:", gpu.name)

This will output the number of available GPUs and their names.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-11 23:04:42 +0000

Seen: 7 times

Last updated: May 11 '23