I get it with the simplest config if I define it as a dataclass, using the example you share as a basis:
config_files/cfg.py
` from hydra.core.config_store import ConfigStore
from dataclasses import dataclass
@dataclass
class MasterConfig:
test: str = 'test'
cs = ConfigStore.instance()
cs.store(name="config", node=MasterConfig) and for the main I had to make some small changes to connect my local server (I'm sharing them just in case): hydra_example.py:
# ClearML - Hydra Example
import hydra
from omegaconf import OmegaConf
from clearml import Task
from dataclasses import dataclass
from config_files import cfg
@dataclass
class CLEARML_SERVER_CONFIG:
API_HOST: str
WEB_HOST: str
FILE_SERVER: str
OUTPUT_URI: str
KEY: str
SECRET: str
# HOST: str
@hydra.main(config_name="config")
def my_app(cfg):
# type (DictConfig) -> None
CLEARML_LOCAL = CLEARML_SERVER_CONFIG(API_HOST=' ` ` ',
WEB_HOST=' ` ` ',
FILE_SERVER=' ` ` ',
OUTPUT_URI=' ` ` ',
KEY='2CBR16L9T9R6ANYTAA5K',
SECRET='pK)i-(ImwRPyL(Eu1nKB5cdy(Y+9_XkGxLrpZmWw0^Abyc7&+b')
# if credentials are not set should offline doesn't work
Task.set_credentials(api_host=CLEARML_LOCAL.API_HOST, web_host=CLEARML_LOCAL.WEB_HOST,
files_host=CLEARML_LOCAL.FILE_SERVER, key=CLEARML_LOCAL.KEY,
secret=CLEARML_LOCAL.SECRET)
task = Task.init(project_name="examples", task_name="hydra configuration")
if name == "main":
my_app() `and the output error is the same as I shared above