用的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出的网站,就可以启动了