Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hello, I Have A Question Regarding The Usage Of

Hello, I have a question regarding the usage of APIClient

from clearml.backend_api.session.client import APIClient client = APIClient() events = client.events.download_task_log(task="2894e6ff98be4f2fab41a0d5df48da0f")
This would result in the following error:
` ---------------------------------------------------------------------------
APIError Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 events = client.events.download_task_log(task="2894e6ff98be4f2fab41a0d5df48da0f")

File ~/mambaforge/envs/tainan-search/lib/python3.8/site-packages/clearml/backend_api/session/client/client.py:379, in make_action.<locals>.new_func(self, *args, **kwargs)
377 @wrap
378 def new_func(self, *args, **kwargs):
--> 379 return Response(self.session.send(request_cls(*args, **kwargs)))

File ~/mambaforge/envs/tainan-search/lib/python3.8/site-packages/clearml/backend_api/session/client/client.py:125, in StrictSession.send(self, request, *args, **kwargs)
123 raise APIError(result)
124 if not result.response:
--> 125 raise APIError(result, extra_info="Invalid response")
126 return result

APIError: APIError: Invalid response: code 200: {"level":"info","worker":"clearml-lt","msg":"ClearML Task: created new task id=2894e6ff98be4f2fab41a0d5df48da0f","@timestamp":"2022-09-21T08:59:00.709Z","metric":"","variant":"","company_id":"","asctime":1619936464857}
{"level":"info","worker":"clearml-lt","msg":"ClearML results page: ","@timestamp":"2022-09-21T08:59:00.709Z","metric":"","variant":"","company_id":"","asctime":1619936472949}
{"level":"info","worker":"clearml-lt","msg":"You can view your full hydra configuration under Configuration tab in the UI\ndataset:\n data: rawdata.csv\n user: root\n password: password\npipeline:\n pipeline_1: my_pipeline","@timestamp":"2022-09-21T08:59:00.709Z","metric":"","variant":"","company_id":"","asctime":1619936473665} `
The task is an official example https://github.com/allegroai/clearml/blob/master/examples/frameworks/hydra/hydra_example.py , and the task output is very simple as the attached screenshot below.

I'm testing it with a self-hosted clearml server, with clearml python package 1.7.0 .

Any idea what's wrong?

  
  
Posted 2 years ago
Votes Newest

Answers 4


Hi JumpyDragonfly13 ! Try using get_task_log instead of download_task_log

  
  
Posted 2 years ago

JumpyDragonfly13 The function was auto-generated from the backend schema, so it was auto-included. This function is actually used by the UI when you press the Download full log button, but the SDK can't call it because the response is simply an octet-stream representing the log (the SDK expects a JSON containing some fields).
Anyway, you could've also done something like this to get the task log:
from clearml import Task t = Task.get_task(task_id="cecc9d51581d4fe3948b857d21af1ff3") print(t.get_reported_console_output(number_of_reports=100))Still, the get_reported_console_output method is a bit limited because you can't iterate through batches for now. If you don't have a lot of logs, you should use this function

  
  
Posted 2 years ago

SmugDolphin23 I see. Thank you

  
  
Posted 2 years ago

SmugDolphin23 Thanks! get_task_log is working fine 🎉

Just wonder why download_task_log is not working? Is it something to be fixed?

  
  
Posted 2 years ago
930 Views
4 Answers
2 years ago
one year ago
Tags