API - Operation System

Operation system, more functions can be found in TensorFlow API.

exit_tf([sess, port]) Close TensorFlow session, TensorBoard and Nvidia-process if available.
open_tb([logdir, port]) Open Tensorboard.
clear_all([printable]) Clears all the placeholder variables of keep prob, including keeping probabilities of all dropout, denoising, dropconnect etc.
set_gpu_fraction([sess, gpu_fraction]) Set the GPU memory fraction for the application.
disable_print() Disable console output, suppress_stdout is recommended.
enable_print() Enable console output, suppress_stdout is recommended.
suppress_stdout() Temporarily disable console output.
get_site_packages_directory() Print and return the site-packages directory.
empty_trash() Empty trash folder.

TensorFlow functions

Close TF session and associated processes

tensorlayer.ops.exit_tf(sess=None, port=6006)[source]

Close TensorFlow session, TensorBoard and Nvidia-process if available.

Parameters:

sess : a session instance of TensorFlow

TensorFlow session

tb_port : an integer

TensorBoard port you want to close, 6006 as default.

Open TensorBoard

tensorlayer.ops.open_tb(logdir='/tmp/tensorflow', port=6006)[source]

Open Tensorboard.

Parameters:

logdir : a string

Directory where your tensorboard logs are saved

port : an integer

TensorBoard port you want to open, 6006 is tensorboard default

Delete placeholder

tensorlayer.ops.clear_all(printable=True)[source]

Clears all the placeholder variables of keep prob, including keeping probabilities of all dropout, denoising, dropconnect etc.

Parameters:

printable : boolean

If True, print all deleted variables.

GPU functions

tensorlayer.ops.set_gpu_fraction(sess=None, gpu_fraction=0.3)[source]

Set the GPU memory fraction for the application.

Parameters:

sess : a session instance of TensorFlow

TensorFlow session

gpu_fraction : a float

Fraction of GPU memory, (0 ~ 1]

References

Console display

Disable print

tensorlayer.ops.disable_print()[source]

Disable console output, suppress_stdout is recommended.

Examples

>>> print("You can see me")
>>> tl.ops.disable_print()
>>> print(" You can't see me")
>>> tl.ops.enable_print()
>>> print("You can see me")

Enable print

tensorlayer.ops.enable_print()[source]

Enable console output, suppress_stdout is recommended.

Examples

  • see tl.ops.disable_print()

Temporary disable print

tensorlayer.ops.suppress_stdout()[source]

Temporarily disable console output.

References

Examples

>>> print("You can see me")
>>> with tl.ops.suppress_stdout():
>>>     print("You can't see me")
>>> print("You can see me")

Site packages information

tensorlayer.ops.get_site_packages_directory()[source]

Print and return the site-packages directory.

Examples

>>> loc = tl.ops.get_site_packages_directory()

Trash

tensorlayer.ops.empty_trash()[source]

Empty trash folder.