# tf.profiler.experimental.start

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/profiler/profiler_v2.py#L80-L126) |

Start profiling TensorFlow performance.

    tf.profiler.experimental.start(
        logdir, options=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `logdir` | Profiling results log directory. |
| `options` | `ProfilerOptions` namedtuple to specify miscellaneous profiler options. See example usage below. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `AlreadyExistsError` | If a profiling session is already running. |

<br />

#### Example usage:

    options = tf.profiler.experimental.ProfilerOptions(host_tracer_level = 3,
                                                       python_tracer_level = 1,
                                                       device_tracer_level = 1)
    tf.profiler.experimental.start('logdir_path', options = options)
    # Training code here
    tf.profiler.experimental.stop()

To view the profiling results, launch TensorBoard and point it to `logdir`.
Open your browser and go to `localhost:6006/#profile` to view profiling
results.