Split reporting example

This commit is contained in:
allegroai 2021-01-18 20:23:19 +02:00
parent 59d26e675b
commit dd3e50523f
4 changed files with 36 additions and 20 deletions

View File

@ -0,0 +1,31 @@
# ClearML - example code, absl parameter logging
#
import sys
from absl import app
from absl import flags
from absl import logging
from clearml import Task
FLAGS = flags.FLAGS
flags.DEFINE_string("echo", None, "Text to echo.")
flags.DEFINE_string("another_str", "My string", "A string", module_name="test")
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="Abseil example")
flags.DEFINE_integer("echo3", 3, "Text to echo.")
flags.DEFINE_string("echo5", "5", "Text to echo.", module_name="test")
def main(_):
print("Running under Python {0[0]}.{0[1]}.{0[2]}".format(sys.version_info), file=sys.stderr)
logging.info("echo is %s.", FLAGS.echo)
logging.info("echo3 is %s.", FLAGS.echo3)
if __name__ == "__main__":
app.run(main)

View File

@ -1,3 +1,4 @@
absl-py>=0.7.1
tensorboard>=2.0
tensorflow>=2.0
clearml

View File

@ -1,4 +1,4 @@
# ClearML - example code, ArgumentParser parameter logging, absl parameter logging, and dictionary parameter logging
# ClearML - example code, ArgumentParser parameter logging and dictionary parameter logging
#
from __future__ import absolute_import
from __future__ import division
@ -7,25 +7,13 @@ from __future__ import print_function
import sys
from argparse import ArgumentParser
from absl import app
from absl import flags
from absl import logging
from clearml import Task
FLAGS = flags.FLAGS
flags.DEFINE_string('echo', None, 'Text to echo.')
flags.DEFINE_string('another_str', 'My string', 'A string', module_name='test')
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='hyper-parameters example')
flags.DEFINE_integer('echo3', 3, 'Text to echo.')
flags.DEFINE_string('echo5', '5', 'Text to echo.', module_name='test')
parameters = {
'list': [1, 2, 3],
'dict': {'a': 1, 'b': 2},
@ -57,11 +45,6 @@ complex_nested_dict_configuration = task.connect_configuration(
print(complex_nested_dict_configuration)
def main(_):
print('Running under Python {0[0]}.{0[1]}.{0[2]}'.format(sys.version_info), file=sys.stderr)
logging.info('echo is %s.', FLAGS.echo)
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--argparser_int_value', help='integer value', type=int, default=1)
@ -70,4 +53,6 @@ if __name__ == '__main__':
args = parser.parse_args()
app.run(main)
print('Running under Python {0[0]}.{0[1]}.{0[2]}'.format(sys.version_info), file=sys.stderr)
task_params = task.get_parameters()
print("Task parameters are: {}".format(task_params))

View File

@ -1,4 +1,3 @@
absl-py>=0.7.1
bokeh>=1.4.0
matplotlib >= 3.1.1 ; python_version >= '3.6'
matplotlib >= 2.2.4 ; python_version < '3.6'