Skip to content

Commit

Permalink
[Auto] Add deprecation warning. Remove autogluon dependency from esti…
Browse files Browse the repository at this point in the history
…mators (dmlc#1718)

* deprecate

* fix

* fix lint

Co-authored-by: Weisu Yin <[email protected]>
  • Loading branch information
yinweisu and yinweisu authored Dec 21, 2021
1 parent 3892d7e commit 6818c32
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
9 changes: 9 additions & 0 deletions gluoncv/auto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
"""GluonCV auto"""
import logging
from .estimators import *

logger = logging.getLogger(__name__)
msg = (
"We plan to deprecate auto from gluoncv on release 0.12.0."
"Please consider using autogluon.vision instead, which provides the same functionality."
"https://auto.gluon.ai/stable/tutorials/image_prediction/index.html"
)
logger.warning(msg)
3 changes: 3 additions & 0 deletions gluoncv/auto/estimators/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BINARY = 'binary'
MULTICLASS = 'multiclass'
REGRESSION = 'regression'
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@
from .... import nn
from .... import loss
from ..base_estimator import BaseEstimator, set_default
from ..constants import BINARY, MULTICLASS, REGRESSION
from .utils import get_data_loader, get_data_rec, smooth, mixup_transform
from .default import ImageClassificationCfg
from ...data.dataset import ImageClassificationDataset
from ..conf import _BEST_CHECKPOINT_FILE
from ..utils import EarlyStopperOnPlateau
from ....utils.filesystem import try_import
problem_type_constants = try_import(package='autogluon.core.constants',
fromlist=['MULTICLASS', 'BINARY', 'REGRESSION'],
message='Failed to import problem type constants from autogluon.core.')
MULTICLASS = problem_type_constants.MULTICLASS
BINARY = problem_type_constants.BINARY
REGRESSION = problem_type_constants.REGRESSION

__all__ = ['ImageClassificationEstimator']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@
from .default import TorchImageClassificationCfg
from .utils import resolve_data_config, update_cfg, optimizer_kwargs, \
create_scheduler, rmse, create_optimizer_v2a
from ..constants import BINARY, MULTICLASS, REGRESSION
from ..utils import EarlyStopperOnPlateau
from ..utils import _suggest_load_context
from ..conf import _BEST_CHECKPOINT_FILE
from ..base_estimator import BaseEstimator, set_default
from ....utils.filesystem import try_import
problem_type_constants = try_import(package='autogluon.core.constants',
fromlist=['MULTICLASS', 'BINARY', 'REGRESSION'],
message='Failed to import problem type constants from autogluon.core.')
MULTICLASS = problem_type_constants.MULTICLASS
BINARY = problem_type_constants.BINARY
REGRESSION = problem_type_constants.REGRESSION

warnings.filterwarnings('ignore', message='.*Argument interpolation should be of type InterpolationMode instead of int.*')
logging.getLogger('timm.models').setLevel(logging.WARNING)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def find_version(*file_paths):

extra_requirements = {
'full': ['tensorboardx', 'decord', 'autogluon.core', 'cython', 'pycocotools'],
'auto': ['autogluon.core']
'auto': ['autogluon.core==0.3.1']
}

if with_cython:
Expand Down

0 comments on commit 6818c32

Please sign in to comment.