ó
Už÷Xc           @` sŤ  d  Z  d d l m Z d d l m Z d d l m Z d d l Z d d l Z d d l m Z d d l m	 Z	 d d l m
 Z
 d d	 l m Z d d
 l m Z d d l m Z d d l m Z d d l m Z e	 j d d d  e	 j d e d  e	 j d d d  e	 j d e d  e	 j d d d  e	 j d d d  e	 j d d d  e	 j d e d   e	 j d! d" d#  e	 j Z d d$  Z e d% k r§e j   n  d S(&   s   Serve TensorFlow summary data to a web frontend.

This is a simple web server to proxy data from the event_loader to the web, and
serve static web files.
i    (   t   absolute_import(   t   division(   t   print_functionN(   t   app(   t   flags(   t   resource_loader(   t
   status_bar(   t
   tf_logging(   t   event_file_inspector(   t   event_multiplexer(   t   servert   logdirt    sö  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
t   debugsL   Whether to run the app in debug mode. This increases log verbosity to DEBUG.t   hosts   0.0.0.0s   What host to listen to. Defaults to serving on 0.0.0.0, set to 127.0.0.1 (localhost) todisable remote access (also quiets security warnings).t   inspectsÁ  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.
t   tagsB   The particular tag to query for. Only used if --inspect is presentt
   event_filesh   The particular event file to query for. Only used if --inspect is present and --logdir is not specified.t   portiv  s"   What port to serve TensorBoard on.t   purge_orphaned_datas   Whether to purge data that may have been orphaned due to TensorBoard restarts. Disabling purge_orphaned_data can be used to debug data disappearance.t   reload_intervali<   s,   How often the backend should load more data.c   	      C` sŁ  t  j j t j  } t  j j t j  } t j rS t j t j	  t j
 d  n  t j r t j
 d  t j | | t j  d S| sŞ d } t j |  t |  d St j
 d t  j    t j |  } t j
 d |  t j d t j d	 t j  } t j | | t j  y" t j | t j t j |  } Wnl t j k
 rŁt j d k rxd
 } t j |  t |  d Sd t j } t j |  t |  d Sn Xy) t j d  j   } t j
 d |  Wn$ t  k
 rót j
 d  d } n Xt! j" d | t j  t d | t j f  t j d k r{y0 t j# t j$    } t d | t j f  Wqt j% k
 rwqXn t d t j t j f  | j&   d  S(   Ns   TensorBoard is in debug mode.s8   Not bringing up TensorBoard, but inspecting event files.i    sN   A logdir must be specified. Run `tensorboard --help` for details and examples.i˙˙˙˙s$   Starting TensorBoard in directory %ss   TensorBoard path_to_run is: %st   size_guidanceR   s   Unable to find any open ports.iţ˙˙˙s3   Tried to connect to port %d, but address is in use.iý˙˙˙s   tensorboard/TAGs   TensorBoard is tag: %ss   Unable to read TensorBoard tagR   s   TensorBoard %ss"   Starting TensorBoard %s on port %ds   0.0.0.0s"   (You can navigate to http://%s:%d)('   t   ost   patht
   expandusert   FLAGSR   R   R   t   loggingt   set_verbosityt   DEBUGt   infoR   t   efiR   t   errort   printt   getcwdR
   t   ParseEventFilesSpecR	   t   EventMultiplexert   TENSORBOARD_SIZE_GUIDANCER   t   StartMultiplexerReloadingThreadR   t   BuildServerR   R   t   socketR   t   load_resourcet   stript   IOErrorR   t   SetupStatusBarInsideGooglet   gethostbynamet   gethostnamet   gaierrort   serve_forever(	   t   unused_argvR   R   t   msgt   path_to_runt   multiplexert	   tb_serverR   R   (    (    sd   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/tensorboard/tensorboard.pyt   mainY   sd    		
		
"


t   __main__(   t   __doc__t
   __future__R    R   R   R   R'   t   tensorflow.python.platformR   R   R   R   R   R   t   tensorflow.python.summaryR   R   R	   t   tensorflow.tensorboard.backendR
   t   DEFINE_stringt   DEFINE_booleant   Falset   DEFINE_integert   TrueR   t   NoneR5   t   __name__t   run(    (    (    sd   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/tensorboard/tensorboard.pyt   <module>   s@   
	A