TensorLayer官方中文文档1.7.4:API – 操作系统管理


所属分类: TensorLayer

API - 操作系统管理¶

系统操作,更多函数可在 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 操作函数¶

中断 Nvidia 进程¶

tensorlayer.ops. exit_tf ( sess=None, port=6006 ) [源代码]

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.

打开 TensorBoard¶

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

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

删除 placeholder¶

tensorlayer.ops. clear_all ( printable=True ) [源代码]

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 配置函数¶

tensorlayer.ops. set_gpu_fraction ( sess=None, gpu_fraction=0.3 ) [源代码]

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

  • TensorFlow using GPU

命令窗口显示¶

禁止 print¶

tensorlayer.ops. disable_print ( ) [源代码]

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")

允许 print¶

tensorlayer.ops. enable_print ( ) [源代码]

Enable console output, suppress_stdout is recommended.

Examples

  • see tl.ops.disable_print()

临时禁止 print¶

tensorlayer.ops. suppress_stdout ( ) [源代码]

Temporarily disable console output.

References

  • stackoverflow

Examples

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

Site packages 信息¶

tensorlayer.ops. get_site_packages_directory ( ) [源代码]

Print and return the site-packages directory.

Examples

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

垃圾管理¶

tensorlayer.ops. empty_trash ( ) [源代码]

Empty trash folder.

艾伯特(http://www.aibbt.com/)国内第一家人工智能门户

你可能感兴趣的:(人工智能)