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
Hi, Not Sure If I'M Doing Something Wrong Or I Found A Bug. When I Try To Overwrite Some Parameters In A Cloned Task Using

Hi, not sure if I'm doing something wrong or I found a bug. When I try to overwrite some parameters in a cloned task using get_parameters and set_parameters combo, it doesn't work as I expected when any parameter is dictionary type (e.g. period = {"start": "2020-01-01 00:00", "end": "2020-12-31 23:00"} ). In the base template task I define that period parameter as period = {"start": None, "end": None} so I can modify it later in the cloned task. But if I print out the parameters connected to the base task once I have overwritten them with set_parameters , all parameters have been modified successfully except those values that are dictionaries.

  
  
Posted 2 years ago
Votes Newest

Answers 7


Yes, when the parameters that are connected do not have nested dictionaries, everything works fine. The problem comes when I try to do something like this:

` from clearml import Task

task = Task.init(project_name="Examples", task_name="task with connected dict")

args = {}
args["period"] = {"start": "2020-01-01 00:00", "end": "2020-12-31 23:00"}

task.connect(args) `
and the clone task is like this:

` from clearml import Task

template_task = Task.get_task(task_id="<Your template task id>")
cloned_task = Task.clone(source_task=template_task,
name=template_task.name+' for params', parent=template_task.id)
cloned_task_parameters = cloned_task.get_parameters()
cloned_task_parameters["period"] = {"start": "2021-05-01 00:00", "end": "2021-08-31 23:00"}

put back into the new cloned task

cloned_task.set_parameters(cloned_task_parameters) `

  
  
Posted 2 years ago

When connecting a nested dict the keys will be in the struct of period/end and period/start , so those are the keys you need to change, in additional to the section name, General if name not given.

This should work for example in your example:

` cloned_task = Task.clone(source_task=template_task,
name=template_task.name+' for params', parent=template_task.id)

put back into the new cloned task

cloned_task.set_parameters({"General/period/start": "0000-05-01 00:00", "General/period/end": "0000-08-31 23:00"}) `
or the code from above too (going over the keys):

` from clearml import Task

template_task = Task.get_task(task_id="<Your template task id>")
cloned_task = Task.clone(source_task=template_task,
name=template_task.name+' for params', parent=template_task.id)
cloned_task_parameters = cloned_task.get_parameters()

override with random samples form grid

for k in cloned_task_parameters.keys():
cloned_task_parameters[k] = "2020-01-01 00:56"

put back into the new cloned task

cloned_task.set_parameters(cloned_task_parameters) `

  
  
Posted 2 years ago

I have only checked it from code.
Exactly, I have followed that same workflow shown in that example. Maybe it has something to do with the dictionary's mutability?

  
  
Posted 2 years ago

can you try those? Do you have an example for the cloning code?

  
  
Posted 2 years ago

Brilliant, that worked like a charm!

  
  
Posted 2 years ago

I just tried and everything works.

I run this for the template task:

` from clearml import Task

task = Task.init(project_name="Examples", task_name="task with connected dict")

period = {"start": "2020-01-01 00:00", "end": "2020-12-31 23:00"}

task.connect(period, name="period") `

and this for the clone one:

` from clearml import Task

template_task = Task.get_task(task_id="<Your template task id>")
cloned_task = Task.clone(source_task=template_task,
name=template_task.name+' for params', parent=template_task.id)
cloned_task_parameters = cloned_task.get_parameters()

override with random samples form grid

for k in cloned_task_parameters.keys():
cloned_task_parameters[k] = "2020-01-01 00:56"

put back into the new cloned task

cloned_task.set_parameters(cloned_task_parameters) `

  
  
Posted 2 years ago

Hi GiganticTurtle0 ,

Does it happen when you change the parameters from the UI too? or only from code? same flow as in https://github.com/allegroai/clearml/blob/master/examples/automation/manual_random_param_search_example.py#L47 ?

  
  
Posted 2 years ago