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 Community, I Might Have A Misunderstanding Of The Use Of Task.Connect Method. It Seems Like The Object I Connect Is Immutable, While It Should Be Mutable.

Hi community,
I might have a misunderstanding of the use of task.connect method.
It seems like the object I connect is immutable, while it should be mutable.

import time
import clearml

args = {"seed": None, "batch_size": 32}

# ClearML stuff
clearml.Task.add_requirements('clearml')
tsk = clearml.Task.init(project_name="combo_model/train", task_name='test', reuse_last_task_id=True)
tsk.execute_remotely(queue_name='rtx3090')
args = tsk.connect(args)

args['batch_size'] = 64
print("Pre modification ", args)
if args['seed'] is None:
    print("No seed provided, using current time as seed")
    args['seed'] = int(time.time())

print("Post modification ", args)

Using this mini test, the dict args doesn't seem to be modified in the last few rows.
The output is
Pre modification {'seed': None, 'batch_size': 32}
No seed provided, using current time as seed
Post modification {'seed': None, 'batch_size': 32}
Any idea someone?

  
  
Posted one month ago
Votes Newest

Answers 3


Hi @<1523703961872240640:profile|CrookedWalrus33> , I think by "mutable" it means that the object itself is mutable when connecting.

I'm curious, what is your use case that you want to change the values in the code itself? The intended usage is to connect the config object and then control it via the webUI / API

  
  
Posted one month ago

Hi @<1523701070390366208:profile|CostlyOstrich36> ,
The idea is indeed to control the object via API, but in that particular case, if I don't want the seed to be specified by the API but just set it to be current timestamp.
Could you think of a better use?

  
  
Posted one month ago

Hi @<1523703961872240640:profile|CrookedWalrus33> ! The way connect works by default is:
While running locally, all the values (and value changes) of a connected object are sent to the backend.
While running remotely (in your case here), all the values sent in the local run are fetched from the backend and the connected dictionary is populated with these values. The values are readonly, chaning them will not have any effect.
To avoid this behaviour, you could use the ignore_remote_overrides=True argument in connect , which will make the connect behave as if it is running locally.

  
  
Posted one month ago
131 Views
3 Answers
one month ago
one month ago
Tags