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
I Cannot Get The Configuration From A Task: I Run

I cannot get the configuration from a task:

I run

from clearml import Task, TaskTypes, Model, OutputModel, InputModel
from clearml.task_parameters import TaskParameters, param, percent_param

parameters = {'var1': 1.0}
task = Task.init(project_name='FirstTrial', task_name='first_trial')
parameters = task.connect(parameters)
parameters['var2'] = 2.0
task.mark_completed()

and then later

from clearml import Task
task_IDs = Task.query_tasks(project_name='FirstTrial', task_name='first_trial')
mytask = Task.get_task(task_IDs[0])
myconf = mytask.get_configuration_objects()

but just myconf is just an empty dict {} . What is the issue here?

  
  
Posted one year ago
Votes Newest

Answers 12


Thanks @<1523704157695905792:profile|VivaciousBadger56> ! great work on the docstring, I also really like the extended example. Let me make sure someone merges it

  
  
Posted one year ago

In the documentation it warns about

.close()

"Only call Task.close if you are certain the Task is not needed."

Maybe this is not clear enough, this means you do not need to automatically Add/Log/Track things into the Task in the current process.
This does Not mean you cannot access the Task or its artifacts

Mark closed means to externally (i..e not from the process that crated the Task, maybe even from a different machine) close and mark the task as completed (this will also means the process running the Task will be closed by the clearml SDK).
does that make sense ?

  
  
Posted one year ago

Ok, I checked: A is terminated. This is not what I thought would happen and not what I intended with my documentation. I should clarify that.

  
  
Posted one year ago

@<1523701205467926528:profile|AgitatedDove14> : Wait, so, if a task is initialized in process A and I call mark_completed in a process B, which process is terminated? A or B?

  
  
Posted one year ago

I created None

  
  
Posted one year ago

Is

mark_completed

used to complete a task from a different process and

close

from the same process - is that the idea?

Yes

However, when I tried them out,

mark_completed

terminated the process that called

mark_completed

.

Yes if you are changing the state of the Task externally or internally the SDK will kill the process. If you are calling task.close() from the process that created the Task it will gracefully close the Task (but not the process)

  
  
Posted one year ago

@<1523701205467926528:profile|AgitatedDove14>

  
  
Posted one year ago

I have... its included in None

  
  
Posted one year ago

@<1523701205467926528:profile|AgitatedDove14> In the documentation it warns about .close() "Only call Task.close if you are certain the Task is not needed."
What does the documentation refer to? My understanding would be that if close the task within a program, I am not able to use the task object anymore as before and I need to retrieve it via query_tasks to get it again. Is that correct?

  
  
Posted one year ago

@<1523701205467926528:profile|AgitatedDove14> : "does that make sense ?" Not really.

"you do not need to automatically Add/Log/Track things into the Task in the current process." - I do not need to automatically do [...]? You mean I can do it automatically, but alternatively I can do it manually? Do you mean I use close within a process to prevent automatic logging/adding/tracking? But, as far as I know, after I used close I am not able to log etc. manually either. So...

"Mark closed" - do you mean close or mark_completed ?

Is mark_completed used to complete a task from a different process and close from the same process - is that the idea? However, when I tried them out, mark_completed terminated the process that called mark_completed . In fact, I wrote that into the docstring of mark_completed and made a pull request, which got accepted. See None

Similarly I updated None

Please check if that was done correctly and update the docstrings accordingly.

  
  
Posted one year ago

Hi @<1523704157695905792:profile|VivaciousBadger56>
You should replace

task.mark_completed()

with:

task.close()

To your point

parameters = task.connect(parameters)

Will be retrieved with:

task.get_parameters()

fyi:
connect_configuration -> get_configuration_objects

  
  
Posted one year ago

Secondly, I do not understand this:

None says

Manually mark a Task as completed. This will close the running process and will change the Task’s status to Completed (Use this function to close and change status of remotely executed tasks). To simply change the Task’s status to completed, use task.close()

None says

Closes the current Task and changes its status to completed. Enables you to manually shutdown the task.
danger: Only call Task.close if you are certain the Task is not needed.

What is the difference? My understanding is, that mark_completed additionally (in contrast to close), kills the current Python process on my local machine. Is that right?

  
  
Posted one year ago
982 Views
12 Answers
one year ago
one year ago
Tags