Unanswered
Hi All. What Is The Most Straightforward Way To Download All Experiment-Related Data (Configs, Scalars, Debug Samples Etc.) For One Experiment From Clearml Server (Self-Hosted)? I Want To Backup Some Chosen Experiments And Also Poke Around The Experimenta
We use task.export_task()
and a hacked version to get console log:
def save_console_log(task: clearml.Task, fs, remote_path, number_of_reports=10000):
from clearml.backend_api.services import events
from clearml.backend_api import Session
# Stollen from Task.get_reported_console_output()
if Session.check_min_api_version('2.9'):
request = events.GetTaskLogRequest(
task=task.id,
order='asc',
navigate_earlier=True,
batch_size=number_of_reports)
else:
request = events.GetTaskLogRequest(
task=task.id,
order='asc',
from_='tail',
batch_size=number_of_reports)
res = task.send(request)
response = res.wait()
if not response.ok() or not response.response_data.get('events'):
print("Warning: No Clearml Console log retrieved")
return
logs = response.response_data['events']
json_data = json.dumps(logs, indent=2)
print(f"Saving ClearML task console logs to {remote_path}")
with fs.open(remote_path, "w") as json_file:
json_file.write(json_data)
121 Views
0
Answers
one year ago
one year ago