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

[Bug] Missing wanbd hook in v1.x.x #1276

Closed
robin-maillot opened this issue Dec 19, 2022 · 1 comment
Closed

[Bug] Missing wanbd hook in v1.x.x #1276

robin-maillot opened this issue Dec 19, 2022 · 1 comment
Assignees
Labels
1.0rc Functionalities for MMClassification 1.0rc

Comments

@robin-maillot
Copy link

Branch

master branch (0.24 or other 0.x version)

Describe the bug

After some issues with the v0.x.x I was recommended to move to v1.x.x . !1259

After finishing migrating all the configs I'm now hitting a wall with wanbd, I cannot figure out the equivalent to :

        dict(
            type="WandbLoggerHook",
            init_kwargs={
                "project": "mmcls",
                "name": "will-be-added-by-train-script",
            },
            interval=100,
            log_checkpoint=False,
            log_checkpoint_metadata=False,
            num_eval_images=100,
        ),

in the new version. Has WandbLoggerHook been removed?

The error I get is :

KeyError: 'WandbLoggerHook is not in the hook registry. Please check whether the value of `WandbLoggerHook` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/tutorials/config.html#import-custom-python-modules'

Any help would be much appreciated.

Environment

{'sys.platform': 'linux',
 'Python': '3.8.15 (default, Oct 12 2022, 19:15:16) [GCC 11.2.0]',
 'CUDA available': True,
 'numpy_random_seed': 2147483648,
 'GPU 0': 'NVIDIA GeForce RTX 3060 Laptop GPU',
 'CUDA_HOME': None,
 'GCC': 'x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0',
 'PyTorch': '1.11.0+cu113',
 'PyTorch compiling details': 'PyTorch built with:\n'
                              '  - GCC 7.3\n'
                              '  - C++ Version: 201402\n'
                              '  - Intel(R) Math Kernel Library Version '
                              '2020.0.0 Product Build 20191122 for Intel(R) 64 '
                              'architecture applications\n'
                              '  - Intel(R) MKL-DNN v2.5.2 (Git Hash '
                              'a9302535553c73243c632ad3c4c80beec3d19a1e)\n'
                              '  - OpenMP 201511 (a.k.a. OpenMP 4.5)\n'
                              '  - LAPACK is enabled (usually provided by '
                              'MKL)\n'
                              '  - NNPACK is enabled\n'
                              '  - CPU capability usage: AVX2\n'
                              '  - CUDA Runtime 11.3\n'
                              '  - NVCC architecture flags: '
                              '-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86\n'
                              '  - CuDNN 8.2\n'
                              '  - Magma 2.5.2\n'
                              '  - Build settings: BLAS_INFO=mkl, '
                              'BUILD_TYPE=Release, CUDA_VERSION=11.3, '
                              'CUDNN_VERSION=8.2.0, '
                              'CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, '
                              'CXX_FLAGS= -Wno-deprecated '
                              '-fvisibility-inlines-hidden -DUSE_PTHREADPOOL '
                              '-fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM '
                              '-DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK '
                              '-DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE '
                              '-DEDGE_PROFILER_USE_KINETO -O2 -fPIC '
                              '-Wno-narrowing -Wall -Wextra '
                              '-Werror=return-type '
                              '-Wno-missing-field-initializers '
                              '-Wno-type-limits -Wno-array-bounds '
                              '-Wno-unknown-pragmas -Wno-sign-compare '
                              '-Wno-unused-parameter -Wno-unused-function '
                              '-Wno-unused-result -Wno-unused-local-typedefs '
                              '-Wno-strict-overflow -Wno-strict-aliasing '
                              '-Wno-error=deprecated-declarations '
                              '-Wno-stringop-overflow -Wno-psabi '
                              '-Wno-error=pedantic -Wno-error=redundant-decls '
                              '-Wno-error=old-style-cast '
                              '-fdiagnostics-color=always -faligned-new '
                              '-Wno-unused-but-set-variable '
                              '-Wno-maybe-uninitialized -fno-math-errno '
                              '-fno-trapping-math -Werror=format '
                              '-Wno-stringop-overflow, LAPACK_INFO=mkl, '
                              'PERF_WITH_AVX=1, PERF_WITH_AVX2=1, '
                              'PERF_WITH_AVX512=1, TORCH_VERSION=1.11.0, '
                              'USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, '
                              'USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, '
                              'USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, '
                              'USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, \n',
 'TorchVision': '0.12.0+cu113',
 'OpenCV': '4.6.0',
 'MMEngine': '0.3.2',
 'MMClassification': '1.0.0rc4+c9d87cb'}

Other information

No response

@ssumoo
Copy link

ssumoo commented Dec 28, 2022

hi, we found a solution to this. In case anyone runs into the same issue. The logging is now moved into the vis_backends, as the new mmcls + mmengine approaches logging as having one logger with multiple visualization backends rather than multiple loggers.

In short, add this to the config instead:

visualizer = dict(
    type="ClsVisualizer",
    vis_backends=[
        dict(type="LocalVisBackend"),  # local HDD backend
        dict(
            type="WandbVisBackend",
            init_kwargs={
                "project": "mmcls",
                "name": "will-be-added-by-train-script",
            },
        ),
    ],
    name="visualizer",
)

@Ezra-Yu Ezra-Yu closed this as completed Jan 3, 2023
@mzr1996 mzr1996 added the 1.0rc Functionalities for MMClassification 1.0rc label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0rc Functionalities for MMClassification 1.0rc
Projects
None yet
Development

No branches or pull requests

4 participants