Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Support MMEngine-based & MMCV-based #108

Merged
merged 15 commits into from
Dec 29, 2022
Merged
1 change: 1 addition & 0 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mmengine
ray[data]==2.2.0
ray[tune]==2.2.0
9 changes: 4 additions & 5 deletions siatune/apis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from pprint import pformat
from typing import Optional

import mmcv
from mmcv.utils import get_logger
import mmengine
from ray.tune import ResultGrid

from siatune.utils import ImmutableContainer
from siatune.utils.logger import get_root_logger


def log_analysis(results: ResultGrid, log_dir: Optional[str] = None) -> None:
Expand All @@ -21,10 +21,9 @@ def log_analysis(results: ResultGrid, log_dir: Optional[str] = None) -> None:
"""

log_dir = osp.join(log_dir or os.getcwd(), 'best_trial')
mmcv.mkdir_or_exist(log_dir)
mmengine.mkdir_or_exist(log_dir)

logger = get_logger(
'siatune', log_file=osp.join(log_dir, 'best_trial.log'))
logger = get_root_logger(log_file=osp.join(log_dir, 'best_trial.log'))
result = results.get_best_result()

logger.info(f'Best Logdir: {result.log_dir}')
Expand Down
2 changes: 1 addition & 1 deletion siatune/codebase/builder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) SI-Analytics. All rights reserved.
from typing import Dict

from mmcv.utils import Registry
from mmengine.registry import Registry

from .base import BaseTask

Expand Down
2 changes: 1 addition & 1 deletion siatune/codebase/cont_test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import numpy as np
import ray
from mmcv.utils import Config
from mmengine.config import Config

from .blackbox import BlackBoxTask
from .builder import TASKS
Expand Down
2 changes: 1 addition & 1 deletion siatune/codebase/disc_test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import numpy as np
import ray
from mmcv.utils import Config
from mmengine.config import Config

from .blackbox import BlackBoxTask
from .builder import TASKS
Expand Down
Loading