From 1ea11fab2a65d418cd577249e82ba66d11ae67ff Mon Sep 17 00:00:00 2001 From: Weisu Yin Date: Mon, 7 Mar 2022 20:29:29 +0000 Subject: [PATCH 1/3] update timm --- gluoncv/auto/__init__.py | 9 --------- .../torch_image_classification.py | 2 +- .../torch_image_classification/utils/optimizer.py | 4 ++-- .../torch_image_classification/utils/utils.py | 2 +- gluoncv/auto/tasks/__init__.py | 10 ++++++++++ 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gluoncv/auto/__init__.py b/gluoncv/auto/__init__.py index d6f96316f0..1c1180ed52 100644 --- a/gluoncv/auto/__init__.py +++ b/gluoncv/auto/__init__.py @@ -1,11 +1,2 @@ """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) diff --git a/gluoncv/auto/estimators/torch_image_classification/torch_image_classification.py b/gluoncv/auto/estimators/torch_image_classification/torch_image_classification.py index ac6181df42..1be5be9c8e 100644 --- a/gluoncv/auto/estimators/torch_image_classification/torch_image_classification.py +++ b/gluoncv/auto/estimators/torch_image_classification/torch_image_classification.py @@ -562,7 +562,7 @@ def _init_trainer(self): optim_kwargs = optimizer_kwargs(cfg=self._cfg) optim_kwargs['feature_lr_mult'] = self._cfg.train.transfer_lr_mult optim_kwargs['fc_lr_mult'] = self._cfg.train.output_lr_mult - self._optimizer = create_optimizer_v2a(self.net, **optim_kwargs) + self._optimizer = create_optimizer_v2(self.net, **optimizer_kwargs(cfg=self._cfg)) else: self._optimizer = create_optimizer_v2(self.net, **optimizer_kwargs(cfg=self._cfg)) self._init_loss_scaler() diff --git a/gluoncv/auto/estimators/torch_image_classification/utils/optimizer.py b/gluoncv/auto/estimators/torch_image_classification/utils/optimizer.py index 1df78cb706..aff18031b4 100644 --- a/gluoncv/auto/estimators/torch_image_classification/utils/optimizer.py +++ b/gluoncv/auto/estimators/torch_image_classification/utils/optimizer.py @@ -5,8 +5,8 @@ def optimizer_kwargs(cfg): kwargs = dict( - optimizer_name=cfg.optimizer.opt, - learning_rate=cfg.train.lr, + opt=cfg.optimizer.opt, + lr=cfg.train.lr, weight_decay=cfg.optimizer.weight_decay, momentum=cfg.optimizer.momentum) if cfg.optimizer.opt_eps is not None: diff --git a/gluoncv/auto/estimators/torch_image_classification/utils/utils.py b/gluoncv/auto/estimators/torch_image_classification/utils/utils.py index c76fa05d8c..12ab6a74b7 100644 --- a/gluoncv/auto/estimators/torch_image_classification/utils/utils.py +++ b/gluoncv/auto/estimators/torch_image_classification/utils/utils.py @@ -31,7 +31,7 @@ def resolve_data_config(cfg, default_cfg={}, model=None, use_test_size=False): # resolve interpolation method interpolation = 'bicubic' - if cfg.data.interpolation is not None: + if cfg.data.interpolation is not None and cfg.data.interpolation != '': interpolation = cfg.data.interpolation elif 'interpolation' in default_cfg: interpolation = default_cfg['interpolation'] diff --git a/gluoncv/auto/tasks/__init__.py b/gluoncv/auto/tasks/__init__.py index 2d6020a9db..4140deb2aa 100644 --- a/gluoncv/auto/tasks/__init__.py +++ b/gluoncv/auto/tasks/__init__.py @@ -1,4 +1,14 @@ """AutoML Tasks""" +import logging + from .image_classification import * from .object_detection import * # from .utils 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) From 848e3b757c2301eeed93d3ffd3b6f28c8f616b69 Mon Sep 17 00:00:00 2001 From: Weisu Yin Date: Mon, 7 Mar 2022 20:46:53 +0000 Subject: [PATCH 2/3] timm version --- .github/workflows/gpu_test.sh | 2 +- tests/py3_auto.yml | 2 +- tools/batch/docker/gluon_cv_job.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gpu_test.sh b/.github/workflows/gpu_test.sh index 657684e310..de502fbc1e 100644 --- a/.github/workflows/gpu_test.sh +++ b/.github/workflows/gpu_test.sh @@ -17,7 +17,7 @@ export KMP_DUPLICATE_LIB_OK=TRUE if [[ $TESTS_PATH == *"auto"* ]]; then echo "Installing autogluon.core and timm for auto module" pip3 install autogluon.core==0.2.0 - pip3 install timm==0.4.12 + pip3 install timm==0.5.4 fi nosetests --process-restartworker --with-timer --timer-ok 5 --timer-warning 20 -x --with-coverage --cover-package $COVER_PACKAGE -v $TESTS_PATH diff --git a/tests/py3_auto.yml b/tests/py3_auto.yml index b9ea3f06db..2242a6827d 100644 --- a/tests/py3_auto.yml +++ b/tests/py3_auto.yml @@ -29,4 +29,4 @@ dependencies: - portalocker - autocfg>=0.0.6 - autogluon.core==0.2.0 - - timm==0.4.12 + - timm==0.5.4 diff --git a/tools/batch/docker/gluon_cv_job.sh b/tools/batch/docker/gluon_cv_job.sh index 353f806e89..f697b3071f 100644 --- a/tools/batch/docker/gluon_cv_job.sh +++ b/tools/batch/docker/gluon_cv_job.sh @@ -29,7 +29,7 @@ else fi; python3 -m pip install --quiet -e . -python3 -m pip install --quiet timm==0.4.12 +python3 -m pip install --quiet timm==0.5.4 cd $WORK_DIR /bin/bash -o pipefail -c "$COMMAND" From a6a7c5047eeabaec1032dc9b5760b638ee6f9fc4 Mon Sep 17 00:00:00 2001 From: Weisu Yin Date: Mon, 7 Mar 2022 20:56:17 +0000 Subject: [PATCH 3/3] trigger build