Exemple #1
0
def main(unused_argv=None):
  util.setup_logging()
  if FLAGS.inspect:
    tf.logging.info('Not bringing up TensorBoard, but inspecting event files.')
    event_file = os.path.expanduser(FLAGS.event_file)
    efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
    return 0
  else:
    def ConstructDebuggerPluginWithGrpcPort(context):
      debugger_plugin = debugger_plugin_lib.DebuggerPlugin(context)
      if FLAGS.debugger_data_server_grpc_port is not None:
        debugger_plugin.listen(FLAGS.debugger_data_server_grpc_port)
      return debugger_plugin

    plugins = [
        core_plugin.CorePlugin,
        scalars_plugin.ScalarsPlugin,
        images_plugin.ImagesPlugin,
        audio_plugin.AudioPlugin,
        graphs_plugin.GraphsPlugin,
        distributions_plugin.DistributionsPlugin,
        histograms_plugin.HistogramsPlugin,
        pr_curves_plugin.PrCurvesPlugin,
        projector_plugin.ProjectorPlugin,
        text_plugin.TextPlugin,
        profile_plugin.ProfilePlugin,
        ConstructDebuggerPluginWithGrpcPort,
    ]

    tb = create_tb_app(plugins)
    run_simple_server(tb)
 def setUp(self):
     super(TestCase, self).setUp()
     util.setup_logging()
     tf.logging.set_verbosity(tf.logging.DEBUG)
     logging.getLogger('werkzeug').setLevel(logging.INFO)
     tf.logging.debug('=== %s ===', self._method)
     db.TESTING_MODE = True
Exemple #3
0
 def setUp(self):
   super(TestCase, self).setUp()
   util.setup_logging()
   tf.logging.set_verbosity(tf.logging.DEBUG)
   logging.getLogger('werkzeug').setLevel(logging.INFO)
   tf.logging.debug('=== %s ===', self._method)
   db.TESTING_MODE = True
Exemple #4
0
def main(unused_argv=None):
    util.setup_logging()
    if FLAGS.inspect:
        tf.logging.info(
            'Not bringing up TensorBoard, but inspecting event files.')
        event_file = os.path.expanduser(FLAGS.event_file)
        efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
        return 0
    else:

        def ConstructDebuggerPluginWithGrpcPort(context):
            debugger_plugin = debugger_plugin_lib.DebuggerPlugin(context)
            if FLAGS.debugger_data_server_grpc_port is not None:
                debugger_plugin.listen(FLAGS.debugger_data_server_grpc_port)
            return debugger_plugin

        plugins = [
            core_plugin.CorePlugin,
            scalars_plugin.ScalarsPlugin,
            images_plugin.ImagesPlugin,
            audio_plugin.AudioPlugin,
            graphs_plugin.GraphsPlugin,
            distributions_plugin.DistributionsPlugin,
            histograms_plugin.HistogramsPlugin,
            pr_curves_plugin.PrCurvesPlugin,
            projector_plugin.ProjectorPlugin,
            text_plugin.TextPlugin,
            profile_plugin.ProfilePlugin,
            ConstructDebuggerPluginWithGrpcPort,
        ]

        tb = create_tb_app(plugins)
        run_simple_server(tb)
def main(unused_argv=None):
  util.setup_logging()
  tb_app = tb_main.create_tb_app(
      assets_zip_provider=get_assets_zip_provider(),
      # We use the standard TensorBoard plugins, plus our Greeter Plugin
      plugins=[
          core_plugin.CorePlugin,
          greeter_plugin.GreeterPlugin,
          scalars_plugin.ScalarsPlugin,
          images_plugin.ImagesPlugin,
          audio_plugin.AudioPlugin,
          graphs_plugin.GraphsPlugin,
          distributions_plugin.DistributionsPlugin,
          histograms_plugin.HistogramsPlugin,
          projector_plugin.ProjectorPlugin,
          text_plugin.TextPlugin,
          profile_plugin.ProfilePlugin,
      ])
  server, url = tb_main.make_simple_server(tb_app)
  logger = logging.getLogger('tensorflow' + util.LogHandler.EPHEMERAL)
  logger.setLevel(logging.INFO)

  tensorboard_name = 'Greeter TensorBoard 0.1.0'

  logger.info('%s at %s (CTRL+C to quit) ', tensorboard_name, url)
  try:
    server.serve_forever()
  finally:
    logger.info('')
Exemple #6
0
def setup_environment():
    """Makes recommended modifications to the environment.

  This functions changes global state in the Python process. Calling
  this function is a good idea, but it can't appropriately be called
  from library routines.
  """
    util.setup_logging()

    # The default is HTTP/1.0 for some strange reason. If we don't use
    # HTTP/1.1 then a new TCP socket and Python thread is created for
    # each HTTP request. The tradeoff is we must always specify the
    # Content-Length header, or do chunked encoding for streaming.
    serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'
Exemple #7
0
def setup_environment():
  """Makes recommended modifications to the environment.

  This functions changes global state in the Python process. Calling
  this function is a good idea, but it can't appropriately be called
  from library routines.
  """
  util.setup_logging()

  # The default is HTTP/1.0 for some strange reason. If we don't use
  # HTTP/1.1 then a new TCP socket and Python thread is created for
  # each HTTP request. The tradeoff is we must always specify the
  # Content-Length header, or do chunked encoding for streaming.
  serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'
Exemple #8
0
def main(unused_argv=None):
    util.setup_logging()
    tb_app = tb_main.create_tb_app(
        assets_zip_provider=get_assets_zip_provider(), plugins=get_plugins())

    server, url = tb_main.make_simple_server(tb_app)

    logger = logging.getLogger('tensorflow' + util.LogHandler.EPHEMERAL)
    logger.setLevel(logging.INFO)
    logger.info('TensorBoard-X (Beholder) 0.1 at %s (CTRL+C to quit)', url)

    try:
        server.serve_forever()
    finally:
        logger.info('')
Exemple #9
0
def main(plugins, assets_zip_provider=None):
    """Main function for TensorBoard.

  This function makes some global changes to the Python environment and
  then delegates to other functions in this module.

  Since this function will generally run forever, it should only be
  called if the Python process is only meant to be a TensorBoard
  server.

  Args:
    plugins: A list of constructor functions for TBPlugin subclasses.
    assets_zip_provider: Delegates to TBContext or uses default if None.

  Returns:
    Process exit code, i.e. 0 if successful or non-zero on failure. In
    practice, an exception will most likely be raised instead of
    returning non-zero.

  :type plugins: list[:class:`base_plugin.TBPlugin`]
  :type assets_zip_provider: () -> file
  :rtype: int
  """
    util.setup_logging()

    if FLAGS.inspect:
        tf.logging.info(
            'Not bringing up TensorBoard, but inspecting event files.')
        event_file = os.path.expanduser(FLAGS.event_file)
        efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
        return 0

    # The default is HTTP/1.0 for some strange reason. If we don't use
    # HTTP/1.1 then a new TCP socket and Python thread is created for
    # each HTTP request. The tradeoff is we must always specify the
    # Content-Length header, or do chunked encoding for streaming.
    serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'

    tb = create_tb_app(plugins, assets_zip_provider)
    run_simple_server(tb)

    return 0
Exemple #10
0
def main(logdir,
         host,
         port,
         reload_interval=DEFAULT_RELOAD_INTERVAL,
         ready_cb=None):
    util.setup_logging()
    plugins = [
        core_plugin.CorePlugin,
        scalars_plugin.ScalarsPlugin,
        images_plugin.ImagesPlugin,
        audio_plugin.AudioPlugin,
        graphs_plugin.GraphsPlugin,
        distributions_plugin.DistributionsPlugin,
        histograms_plugin.HistogramsPlugin,
        projector_plugin.ProjectorPlugin,
        text_plugin.TextPlugin,
        profile_plugin.ProfilePlugin,
    ]
    app = create_app(plugins, logdir, reload_interval)
    run_simple_server(app, host, port, ready_cb)
Exemple #11
0
def main(unused_argv=None):
    util.setup_logging()
    if FLAGS.inspect:
        tf.logging.info(
            'Not bringing up TensorBoard, but inspecting event files.')
        event_file = os.path.expanduser(FLAGS.event_file)
        efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
        return 0
    else:
        plugins = [
            core_plugin.CorePlugin,
            scalars_plugin.ScalarsPlugin,
            images_plugin.ImagesPlugin,
            audio_plugin.AudioPlugin,
            graphs_plugin.GraphsPlugin,
            distributions_plugin.DistributionsPlugin,
            histograms_plugin.HistogramsPlugin,
            projector_plugin.ProjectorPlugin,
            text_plugin.TextPlugin,
        ]
        tb = create_tb_app(plugins)
        run_simple_server(tb)
Exemple #12
0
def _setup_logging_legacy():
    tb_util.setup_logging()
    _filter_logging()