TensorFlow logging made easy
Project description
Easy TensorFlow Logging
Are you prototyping something and want to be able to magically graph some value without going through all the usual steps to set up TensorFlow logging properly?
easy-tf-log
is a simple module to do just that.
from easy_tf_log import tflog
then you can do
for i in range(10):
tflog('really_interesting_variable_name', i)
and you'll find a directory logs
that you can point TensorBoard to
$ tensorboard --logdir logs
to get
Based on logging code from OpenAI's baselines.
Installation
pip install easy-tf-log
Note that TensorFlow must be installed separately.
Usage
By default, easy-tf-log
saves event files to a directory logs
.
To change the directory, call easy_tf_log.set_dir(log_dir)
.
easy-tf-log
also supports writing using an existing EventFileWriter
created
by e.g. an instance of tf.summary.FileWriter
: call
easy_tf_log.set_writer(file_writer.event_writer)
. (However, not that because
EventsFileWriter
uses a sub-thread to write events, this is not fork-safe. If
you set this in one process and then try to use easy-tf-log
a child process,
it will hang.)
To log a value, use tflog(key, value)
. The step number for each key starts from zero
and increments automatically. To set the step manually, specify the step
argument.
See demo.py
for a full demo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for easy_tf_log-1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8674540e88562c25ca3f4eeee11acc4bfa95a8dc57c7ca2e1e07363db4681e50 |
|
MD5 | dec25b6b29338225d84f721496004489 |
|
BLAKE2b-256 | 549760ceec0c5755a3a829a3dca8bd5b4795376815d5815c0f84188679697b9d |