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! Is There Any Reason Why Integer/Float Values Are Casted To String When Connecting Arguments Dictionary To Task And Then Retrieve Them Using

Hi! Is there any reason why integer/float values are casted to string when connecting arguments dictionary to task and then retrieve them using task.get_parameters_as_dict ?

  
  
Posted 3 years ago
Votes Newest

Answers 10


When using argparse, the SDK should also cast correctly

  
  
Posted 3 years ago

Mmm I see. So the agent is taking the parameters from the base task registered in the server. Then if I call task.get_parameter_as_dict for a task that has not been executed by an agent, should I get the original types of the values?

  
  
Posted 3 years ago

GiganticTurtle0 are you connecting argparse or a dictionary?

  
  
Posted 3 years ago

Then if I call 

task.get_parameter_as_dict

 for a task that has not been executed by an agent, should I get the original types of the values?

You should get them back correctly no matter if you run the task locally (where the values are actually local and have the correct types) or remotely (where the SDK code should cast them to the original type)

  
  
Posted 3 years ago

GiganticTurtle0 , does it pose some sort of problem? What version are you using?

  
  
Posted 3 years ago

GiganticTurtle0
I think that what you are looking for is:
param_dict = {'key': 1234} task.connect(param_dict, name='general')Notice that when this code runs manually (i.e. not by the agent), the dict is stored on "general" parameter section of the Task.
But when the code is executed by the Agent, the opposite happens and the parameters from the "general" section of the Task or put back into the param_dict , here the casting is done based on the type of the original values.
Generally speaking, there is no need to manually call "get_parameters_as_dict".
Make sense ?

  
  
Posted 3 years ago

SuccessfulKoala55 I have not tried yet with argparse, but maybe I will encounter the same problem

  
  
Posted 3 years ago

Well, I need to write boilerplate code to do parsing stuff if I want to use the original values after I connect the dictionary to the task, so it's a bit messy.
Currently I'm using clearml v1.0.5 and clearml-agent v1.0.0

  
  
Posted 3 years ago

Only the dictionary keys are returned as the raw nested dictionary, but the values remain casted.

Using which function ? task.get_parameters_as_dict does not cast the values (the values themselves are stored as strings on the backend), only task.connect will cast the values automatically

  
  
Posted 3 years ago

For any reason I can't get the values in their original types. Only the dictionary keys are returned as the raw nested dictionary, but the values remain casted.

  
  
Posted 3 years ago
923 Views
10 Answers
3 years ago
one year ago
Tags