Unanswered
Hi, I Have A Case When I Want To Clone Tasks And Set Some Parameters For Them. I Noticed, That I Can'T Pass Numbers, Only Strings Are Possible There. When I'M Trying To Pass A Number, The Default Value Is Not Overriden. Do You Know Maybe If Numbers Can Be
RoundMosquito25 you might need to use cast=True
when you get the parameters.
See this snippet:
` from clearml import Task
t = Task.init()
params = {}
params["Function"] = {}
params["Function"]["number"] = 123
t.set_parameters_as_dict(params)
t.close()
cloned = Task.clone(t.id)
s = cloned.get_parameters_as_dict(cast=True)
s["Function"]["number"] = 321
cloned.set_parameters_as_dict(s)
print(type(cloned.get_parameters_as_dict(cast=True)["Function"]["number"])) # will print 'int' `
198 Views
0
Answers
one year ago
one year ago