allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution

Home Page:https://clear.ml/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OutputModel.config_dict causes "E AttributeError: 'DummyModel' object has no attribute 'locked'"

dpinol opened this issue · comments

Describe the bug

Exception when calling assigning config_dict to an offline Task.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dani/.local/share/virtualenvs/sc-api-DipHMMiG/lib/python3.11/site-packages/clearml/model.py", line 2111, in config_dict
    self.update_design(config_dict=value)
  File "/home/dani/.local/share/virtualenvs/sc-api-DipHMMiG/lib/python3.11/site-packages/clearml/model.py", line 2697, in update_design
    if not self._validate_update():
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dani/.local/share/virtualenvs/sc-api-DipHMMiG/lib/python3.11/site-packages/clearml/model.py", line 2846, in _validate_update
    if self.id and self.published:
                   ^^^^^^^^^^^^^^
  File "/home/dani/.local/share/virtualenvs/sc-api-DipHMMiG/lib/python3.11/site-packages/clearml/model.py", line 2071, in published
    return self._get_base_model().locked
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DummyModel' object has no attribute 'locked'

To reproduce

from clearml import OutputModel, Task
Task.set_offline(True)
_writer: Task = Task.init(project_name="test", task_name="task")
_curr_model = OutputModel(task=self._writer, name="curr")
_curr_model = OutputModel(task=_writer, name="curr")
_curr_model.config_dict = {"kk": 3}

## Expected behaviour
No error

## Environment
* Server type (app.clear.ml)
* ClearML SDK Version: 1.15.0
* Python Version: 3.11.5
* OS: Ubuntu 23.10
 

Thanks for letting us know @dpinol - Hope to have a fix available soon.