Skip to content

AttributeError: 'NoneType' object has no attribute 'extra_repr'Β #1070

@djmnb

Description

@djmnb

Prerequisite

🐞 Describe the bug

(myyolo) [DJM@localhost mmyolo]$ python tools/analysis_tools/get_flops.py configs/yolov8/yolov8_s_syncbn_fast_8xb16-500e_coco.py --show-arch
Switch model to deploy modality.
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::silu_ encountered 57 time(s)
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::add encountered 6 time(s)
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::max_pool2d encountered 3 time(s)
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::mul encountered 3 time(s)
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::softmax encountered 3 time(s)
09/13 18:18:03 - mmengine - WARNING - The following submodules of the model were never called during the trace of the graph. They may be unused, or they were accessed by direct calls to .forward() or via other python methods. In the latter case they will have zeros for statistics, though their statistics will still contribute to their parent calling module.
bbox_head.assigner, bbox_head.loss_bbox, bbox_head.loss_cls, bbox_head.loss_dfl, data_preprocessor
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::batch_norm encountered 57 time(s)
09/13 18:18:03 - mmengine - WARNING - Unsupported operator aten::upsample_nearest2d encountered 2 time(s)
Traceback (most recent call last):
File "/home/DJM/object-detection/mmyolo/tools/analysis_tools/get_flops.py", line 123, in
main()
File "/home/DJM/object-detection/mmyolo/tools/analysis_tools/get_flops.py", line 98, in main
result = inference(args, logger)
File "/home/DJM/object-detection/mmyolo/tools/analysis_tools/get_flops.py", line 80, in inference
outputs = get_model_complexity_info(
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 767, in get_model_complexity_info
complexity_arch = complexity_stats_str(
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 547, in complexity_stats_str
model_string += _model_stats_str(model, stats) # type: ignore
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 280, in _model_stats_str
return repr_with_statistics(model, '')
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 264, in repr_with_statistics
submod_str = repr_with_statistics(submod, submod_name)
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 264, in repr_with_statistics
submod_str = repr_with_statistics(submod, submod_name)
File "/home/DJM/miniconda3/envs/myyolo/lib/python3.9/site-packages/mmengine/analysis/print_helper.py", line 252, in repr_with_statistics
extra_repr = module.extra_repr()
AttributeError: 'NoneType' object has no attribute 'extra_repr'

Environment

sys.platform: linux
Python: 3.9.21 (main, Dec 11 2024, 16:24:11) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0: Tesla V100-PCIE-32GB
CUDA_HOME: None
GCC: gcc (GCC) 5.2.0
PyTorch: 1.12.1+cu102
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.2
  • 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
  • CuDNN 7.6.5
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -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-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.12.1, 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,

TorchVision: 0.13.1+cu102
OpenCV: 4.12.0
MMEngine: 0.10.7
MMCV: 2.0.1
MMDetection: 3.3.0
MMYOLO: 0.6.0+dd260d9

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions