Should calling Task.init()
/ task.close()
multiple times work? I have some code like this and it seems to dead-lock:
` for lr in [0.001, 0.0001]:
task = clearml.Task.init(project_name="p", task_name="t", reuse_last_task_id=False)
task.set_parameters(learning_rate=lr)
train model ...
task.close() This works on the first iteration of the loop, but the second one seems to get stuck. When I interrupt, it seems it's trying to get a lock in
init :
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/task.py", line 791, in init
task.set_progress(0)
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/task.py", line 1377, in set_progress
self._set_runtime_properties({"progress": str(progress)})
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/backend_interface/task/task.py", line 2099, in _set_runtime_properties
with self._edit_lock:
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/utilities/locks/utils.py", line 229, in enter
return self.acquire()
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/utilities/locks/utils.py", line 289, in acquire
fh = super(RLock, self).acquire(timeout, check_interval,
File "/opt/homebrew/anaconda3/envs/obelisk-0/lib/python3.9/site-packages/clearml/utilities/locks/utils.py", line 139, in acquire
time.sleep(check_interval) `