When using argparse, the SDK should also cast correctly
GiganticTurtle0 are you connecting argparse or a dictionary?
GiganticTurtle0 , does it pose some sort of problem? What version are you using?
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
SuccessfulKoala55 I have not tried yet with argparse, but maybe I will encounter the same problem
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 ?
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)
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.
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
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?