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

命令窗口顯示

禁止 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

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/)國內第一家人工智能門戶
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章