tensorflow中可視化tensorboard的啓動

用的tensorflow的版本是1.2.1(cpu)版本,在pycharm上啓動。之前一直沒弄好,看了別人的博客,可能是因爲我的版本不一樣,所以實現不了。後來看了help文檔之後,等顯示了。

1.help文檔

usage: tensorboard-script.py [-h] [--logdir LOGDIR] [--host HOST]
                             [--port PORT]
                             [--purge_orphaned_data [PURGE_ORPHANED_DATA]]
                             [--nopurge_orphaned_data]
                             [--reload_interval RELOAD_INTERVAL]
                             [--inspect [INSPECT]] [--noinspect] [--tag TAG]
                             [--event_file EVENT_FILE]


optional arguments:
  -h, --help            show this help message and exit
  --logdir LOGDIR       logdir specifies the directory where TensorBoard will
                        look to find TensorFlow event files that it can
                        display. TensorBoard will recursively walk the
                        directory structure rooted at logdir, looking for
                        .*tfevents.* files. You may also pass a comma
                        separated list of log directories, and TensorBoard
                        will watch each directory. You can also assign names
                        to individual log directories by putting a colon
                        between the name and the path, as in tensorboard
                        --logdir=name1:/path/to/logs/1,name2:/path/to/logs/2

  --host HOST           What host to listen to. Defaults to serving on all
                        interfaces, set to 127.0.0.1 (localhost) todisable
                        remote access (also quiets security warnings).
  --port PORT           What port to serve TensorBoard on.
  --purge_orphaned_data [PURGE_ORPHANED_DATA]
                        Whether to purge data that may have been orphaned due
                        to TensorBoard restarts. Disabling purge_orphaned_data
                        can be used to debug data disappearance.
  --nopurge_orphaned_data
  --reload_interval RELOAD_INTERVAL
                        How often the backend should load more data.
  --inspect [INSPECT]   Use this flag to print out a digest of your event
                        files to the command line, when no data is shown on
                        TensorBoard or the data shown looks weird. Example
                        usages: tensorboard --inspect
                        --event_file=myevents.out tensorboard --inspect
                        --event_file=myevents.out --tag=loss tensorboard
                        --inspect --logdir=mylogdir tensorboard --inspect
                        --logdir=mylogdir --tag=loss See
                        tensorflow/python/summary/event_file_inspector.py for
                        more info and detailed usage.
  --noinspect
  --tag TAG             The particular tag to query for. Only used if
                        --inspect is present
  --event_file EVENT_FILE
                        The particular event file to query for. Only used if
                        --inspect is present and --logdir is not specified.

官方給的help 文檔寫的很清晰:

具體的實現:

1.先將所在項目的文件夾設置爲根目錄


比如這樣的,右擊點擊項目名字Mark directory as-》source  

2.打開pycharm中Terminal

輸入一下命令:tensorboard --logdir=name1:/sources root/要啓動的程序名

比如:tensorboard --logdir=name1:/sources root/testtfcnn.py

然後會得到:


(E:\Anaconda3\Anaconda\envs\tfpy35) E:\tensorflowproject\tf>tensorboard --logdir=name1:/sources root/testtfcnn.py
Starting TensorBoard b'54' at http://ZN-PC:6006
(Press CTRL+C to quit)

用谷歌瀏覽器:輸入 http://ZN-PC:6006出的網站,就可以啓動了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章