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
If I Create A Task Using Task.Create And Then In A Separate Piece Of Code I Want To Report To It (By Using

If I create a task using Task.create and then in a separate piece of code I want to report to it (by using Task.get_task(task_id) ), can I still use the automatical capturing of existing prints, or do I have to explicitely log things using the Logger ? Perhaps the capture_loggin context will help me?

  
  
Posted one year ago
Votes Newest

Answers 30


maybe not at the top but in the Task.init description

  
  
Posted one year ago

yes, I am calling Task.init

  
  
Posted one year ago

YEY 🎉 🎊

  
  
Posted one year ago

but perhaps it is worth adding to the docs page a hint to avoid using the CLEARML_TASK_ID env variable, perhaps I am not the only one to ever try it

  
  
Posted one year ago

report_scalar works, report_text does not, this is very weird

  
  
Posted one year ago

maybe another warning here? https://clear.ml/docs/latest/docs/references/sdk/task/

  
  
Posted one year ago

no, I set the env variable CLEARML_TASK_ID myself

  
  
Posted one year ago

I can hardcode it into program if you want

  
  
Posted one year ago

LOL, great minds and so on 🙂

  
  
Posted one year ago

the situation is:
I can report a scalar by calling clearml_task.logger.report_scalar and it becomes immediately visible in the web ui

  
  
Posted one year ago

now it stopped working locally as well

At least this is consistent 🙂
How so ? Is the "main" Task still running ?

  
  
Posted one year ago

now it stopped working locally as well

  
  
Posted one year ago

task status is running in the webui

  
  
Posted one year ago

my code snippet
` from clearml import Task
import os

clearml_task_id = os.environ['CLEARML_TASK_ID']
Task.debug_simulate_remote_task(clearml_task_id)
clearml_task = Task.init(auto_connect_arg_parser=False, auto_resource_monitoring=False)
print(clearml_task.id)
clearml_task.logger.report_scalar(series='s', value='123', iteration=2, title='title')
clearml_task.logger.report_text("some text") `

  
  
Posted one year ago

I don't know whether you have access to the backend,

Creepy , no I do not 🙂

I can't make anything appear in the console part of the ui

clearml_task.logger.report_text("some text") should work

  
  
Posted one year ago

I can't make anything appear in the console part of the ui

  
  
Posted one year ago

but perhaps it is worth adding to the docs page a hint to avoid using the CLEARML_TASK_ID env variable, perhaps I am not the only one to ever try it

Good idea, any thoughts on where ? I cannot find a trivial place to put these things

  
  
Posted one year ago

but seriously, I am very thankful you were willing to spend so much time helping me, I am super impressed by your response time and helpfulness!

  
  
Posted one year ago

console output:
ClearML results page: 01b77a220869442d80af42efce82c617 some text 2022-03-21 22:47:16,660 - clearml.Task - INFO - Waiting to finish uploads 2022-03-21 22:47:28,217 - clearml.Task - INFO - Finished uploading

  
  
Posted one year ago

I see the text on my screen

  
  
Posted one year ago

So it is the automagic that is not working.
Can you print the following before calling Both Task.debug_simulate_remote_task and Task.init , Notice you have to call Task.init
print(os.environ)

  
  
Posted one year ago

Wait, how did you end up with
clearml_task_id = os.environ['CLEARML_TASK_ID']printing "01b77a220869442d80af42efce82c617" ?
This means you are running by an agent?!

  
  
Posted one year ago

I guess we should have obfuscated the name better 😄

  
  
Posted one year ago

yes, I don't know whether you have access to the backend, but just in case my experiment is this one:
ClearML results page: https://app.clear.ml/projects/45557a1ee1464631a9a18b0dcda4f682/experiments/01b77a220869442d80af42efce82c617/output/log

  
  
Posted one year ago

Just to let you know, it now works (obviously) in the k8s setting as well.

  
  
Posted one year ago

Thank you! 😊

  
  
Posted one year ago

no, I set the env variable CLEARML_TASK_ID myself

Do not, this is the issue 🙂
this is used internally and messing up the internal state, basically this is one of the signals for the SDK to know there is an agent taking care of things (for example logging the entire console output)
Use any other variable, for example MY_CLEARML_TASK_ID

  
  
Posted one year ago

I could have been more inventive as well 😄

  
  
Posted one year ago

wow

  
  
Posted one year ago

report_text does not, this is very weird

Okay this seems to be the issue.
Just making sure the Task status is "running" and task.get_logger().report_text("something") does not report a thing ?
Do you see it on your screen?
Can you test without the "Task.debug_simulate_remote_task / init" ?

  
  
Posted one year ago
394 Views
30 Answers
one year ago
10 months ago
Tags