1414
1515
1616def exit_tf (sess = None , port = 6006 ):
17- """Close tensorflow session, tensorboard and nvidia -process if available
17+ """Close TensorFlow session, TensorBoard and Nvidia -process if available.
1818
1919 Parameters
2020 ----------
2121 sess : a session instance of TensorFlow
2222 TensorFlow session
2323 tb_port : an integer
24- TensorBoard port you want to close, 6006 is tensorboard default
24+ TensorBoard port you want to close, 6006 as default.
2525 """
26- text = "[tl ] Close tensorboard and nvidia-process if available"
27- text2 = "[tl ] Close tensorboard and nvidia-process not yet supported by this function (tl.ops.exit_tf) on "
26+ text = "[TL ] Close tensorboard and nvidia-process if available"
27+ text2 = "[TL ] Close tensorboard and nvidia-process not yet supported by this function (tl.ops.exit_tf) on "
2828 if sess != None :
2929 sess .close ()
3030 # import time
@@ -54,11 +54,11 @@ def open_tb(logdir='/tmp/tensorflow', port=6006):
5454 port : an integer
5555 TensorBoard port you want to open, 6006 is tensorboard default
5656 """
57- text = "[tl ] Open tensorboard, go to localhost:" + str (port ) + " to access"
57+ text = "[TL ] Open tensorboard, go to localhost:" + str (port ) + " to access"
5858 text2 = " not yet supported by this function (tl.ops.open_tb)"
5959
6060 if not tl .files .exists_or_mkdir (logdir , verbose = False ):
61- print ("[tl ] Log reportory was created at %s" % logdir )
61+ print ("[TL ] Log reportory was created at %s" % logdir )
6262
6363 if _platform == "linux" or _platform == "linux2" :
6464 print ('linux %s' % text2 )
@@ -128,7 +128,7 @@ def set_gpu_fraction(sess=None, gpu_fraction=0.3):
128128 ----------
129129 - `TensorFlow using GPU <https://www.tensorflow.org/versions/r0.9/how_tos/using_gpu/index.html>`_
130130 """
131- print (" tensorlayer : GPU MEM Fraction %f" % gpu_fraction )
131+ print ("[TL] : GPU MEM Fraction %f" % gpu_fraction )
132132 gpu_options = tf .GPUOptions (per_process_gpu_memory_fraction = gpu_fraction )
133133 sess = tf .Session (config = tf .ConfigProto (gpu_options = gpu_options ))
134134 return sess
@@ -220,10 +220,10 @@ def get_site_packages_directory():
220220 import site
221221 try :
222222 loc = site .getsitepackages ()
223- print (" tl.ops : site-packages in " , loc )
223+ print ("[TL] tl.ops : site-packages in " , loc )
224224 return loc
225225 except :
226- print (" tl.ops : Cannot find package dir from virtual environment" )
226+ print ("[TL] tl.ops : Cannot find package dir from virtual environment" )
227227 return False
228228
229229
@@ -232,7 +232,7 @@ def empty_trash():
232232 """Empty trash folder.
233233
234234 """
235- text = "[tl ] Empty the trash"
235+ text = "[TL ] Empty the trash"
236236 if _platform == "linux" or _platform == "linux2" :
237237 print ('linux: %s' % text )
238238 os .system ("rm -rf ~/.local/share/Trash/*" )
0 commit comments