I hereby claim:
- I am arthurcamara on github.
- I am acamara (https://keybase.io/acamara) on keybase.
- I have a public key ASCXvOygVHGospMEYXM_v2e-N8MH3o3X7GrMYgxBGFr7Gwo
To claim this, I am signing this object:
import os | |
import numpy as np | |
def get_free_gpus(n_gpus=2): | |
os.system('nvidia-smi -q -d Memory |grep -A4 GPU|grep Free >tmp') | |
memory_available = np.array([int(x.split()[2]) for x in open('tmp', 'r').readlines()]) | |
good_gpus = list((np.array(memory_available) > 6000).nonzero()[0]) | |
if len(good_gpus) == 0: | |
raise IndexError | |
good_gpus = good_gpus[:n_gpus] |
I hereby claim:
To claim this, I am signing this object: