Skip to content

Needed tweaks to get a GPU to recognize the code  #18

@epowell101

Description

@epowell101

The Bert4Eth model uses TensorFlow v 1 - and disables v 2. This may have something to do with why I had a hard time getting the code to recognize available GPUs.

Ultimately I added the following to help with troubleshooting and assigning the GPU:
gpus = tf.config.list_physical_devices('GPU')
if gpus:
try:
tf.config.set_visible_devices(gpus[0], 'GPU')
logical_gpus = tf.config.list_logical_devices('GPU')
print(len(logical_gpus), "Physical GPUs,", len(logical_gpus), "Logical GPU")
except RuntimeError as e:
print(e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions