Skip to content

Instantly share code, notes, and snippets.

@iryek219
Created July 25, 2020 14:40
Show Gist options
  • Save iryek219/5461f92fc9d6532190df1472c0e4ae54 to your computer and use it in GitHub Desktop.
Save iryek219/5461f92fc9d6532190df1472c0e4ae54 to your computer and use it in GitHub Desktop.
Colab memory info
from psutil import virtual_memory
ram_gb = virtual_memory().total / 1e9
print('Your runtime has {:.1f} gigabytes of available RAM\n'.format(ram_gb))
if ram_gb < 20:
print('To enable a high-RAM runtime, select the Runtime > "Change runtime type"')
print('menu, and then select High-RAM in the Runtime shape dropdown. Then, ')
print('re-execute this cell.')
else:
print('You are using a high-RAM runtime!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment