Last active
February 21, 2018 19:34
-
-
Save previtus/c915b322911a545af1db45721a1ba57f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#when facing similar issue to the one mentioned at https://github.com/tensorflow/tensorflow/issues/1439 | |
import tensorflow as tf | |
print("Count of global variables", len(tf.global_variables())) | |
print("Count of graph elements",len(tf.get_default_graph().get_operations())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def memory_check(): | |
import os, subprocess | |
out = subprocess.Popen(['ps', 'v', '-p', str(os.getpid())], stdout=subprocess.PIPE).communicate()[0].split(b'\n') | |
vsz_index = out[0].split().index(b'RSS') | |
mem = float(out[1].split()[vsz_index]) / 1024 | |
print("Memory:", mem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment