Coder Social home page Coder Social logo

open-mmlab / mmyolo Goto Github PK

View Code? Open in Web Editor NEW
2.7K 33.0 496.0 3.75 MB

OpenMMLab YOLO series toolbox and benchmark. Implemented RTMDet, RTMDet-Rotated,YOLOv5, YOLOv6, YOLOv7, YOLOv8,YOLOX, PPYOLOE, etc.

Home Page: https://mmyolo.readthedocs.io/zh_CN/dev/

License: GNU General Public License v3.0

Python 99.51% Shell 0.11% Dockerfile 0.11% CMake 0.06% C++ 0.21%
object-detection pytorch yolo yolov5 yolov6 yolox rtmdet yolov7 yolov8 ppyoloe

mmyolo's Introduction

English | 简体中文

📄 Table of Contents

🥳 🚀 What's New 🔝

💎 v0.6.0 was released on 15/8/2023:

  • Support YOLOv5 instance segmentation
  • Support YOLOX-Pose based on MMPose
  • Add 15 minutes instance segmentation tutorial.
  • YOLOv5 supports using mask annotation to optimize bbox
  • Add Multi-scale training and testing docs

For release history and update details, please refer to changelog.

✨ Highlight 🔝

We are excited to announce our latest work on real-time object recognition tasks, RTMDet, a family of fully convolutional single-stage detectors. RTMDet not only achieves the best parameter-accuracy trade-off on object detection from tiny to extra-large model sizes but also obtains new state-of-the-art performance on instance segmentation and rotated object detection tasks. Details can be found in the technical report. Pre-trained models are here.

PWC PWC PWC

Task Dataset AP FPS(TRT FP16 BS1 3090)
Object Detection COCO 52.8 322
Instance Segmentation COCO 44.6 188
Rotated Object Detection DOTA 78.9(single-scale)/81.3(multi-scale) 121

MMYOLO currently implements the object detection and rotated object detection algorithm, but it has a significant training acceleration compared to the MMDeteciton version. The training speed is 2.6 times faster than the previous version.

📖 Introduction 🔝

MMYOLO is an open source toolbox for YOLO series algorithms based on PyTorch and MMDetection. It is a part of the OpenMMLab project.

The master branch works with PyTorch 1.6+.

Major features
  • 🕹️ Unified and convenient benchmark

    MMYOLO unifies the implementation of modules in various YOLO algorithms and provides a unified benchmark. Users can compare and analyze in a fair and convenient way.

  • 📚 Rich and detailed documentation

    MMYOLO provides rich documentation for getting started, model deployment, advanced usages, and algorithm analysis, making it easy for users at different levels to get started and make extensions quickly.

  • 🧩 Modular Design

    MMYOLO decomposes the framework into different components where users can easily customize a model by combining different modules with various training and testing strategies.

BaseModule-P5 The figure above is contributed by RangeKing@GitHub, thank you very much!

And the figure of P6 model is in model_design.md.

🛠️ Installation 🔝

MMYOLO relies on PyTorch, MMCV, MMEngine, and MMDetection. Below are quick steps for installation. Please refer to the Install Guide for more detailed instructions.

conda create -n mmyolo python=3.8 pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch -y
conda activate mmyolo
pip install openmim
mim install "mmengine>=0.6.0"
mim install "mmcv>=2.0.0rc4,<2.1.0"
mim install "mmdet>=3.0.0,<4.0.0"
git clone https://github.com/open-mmlab/mmyolo.git
cd mmyolo
# Install albumentations
pip install -r requirements/albu.txt
# Install MMYOLO
mim install -v -e .

👨‍🏫 Tutorial 🔝

MMYOLO is based on MMDetection and adopts the same code structure and design approach. To get better use of this, please read MMDetection Overview for the first understanding of MMDetection.

The usage of MMYOLO is almost identical to MMDetection and all tutorials are straightforward to use, you can also learn about MMDetection User Guide and Advanced Guide.

For different parts from MMDetection, we have also prepared user guides and advanced guides, please read our documentation.

Get Started
Recommended Topics
Common Usage
Useful Tools
Basic Tutorials
Advanced Tutorials
Descriptions

📊 Overview of Benchmark and Model Zoo 🔝

Results and models are available in the model zoo.

Supported Tasks
  • Object detection
  • Rotated object detection
Supported Algorithms
Supported Datasets
  • COCO Dataset
  • VOC Dataset
  • CrowdHuman Dataset
  • DOTA 1.0 Dataset
Module Components
Backbones Necks Loss Common
  • YOLOv5CSPDarknet
  • YOLOv8CSPDarknet
  • YOLOXCSPDarknet
  • EfficientRep
  • CSPNeXt
  • YOLOv7Backbone
  • PPYOLOECSPResNet
  • mmdet backbone
  • mmcls backbone
  • timm
  • YOLOv5PAFPN
  • YOLOv8PAFPN
  • YOLOv6RepPAFPN
  • YOLOXPAFPN
  • CSPNeXtPAFPN
  • YOLOv7PAFPN
  • PPYOLOECSPPAFPN
  • IoULoss
  • mmdet loss

❓ FAQ 🔝

Please refer to the FAQ for frequently asked questions.

🙌 Contributing 🔝

We appreciate all contributions to improving MMYOLO. Ongoing projects can be found in our GitHub Projects. Welcome community users to participate in these projects. Please refer to CONTRIBUTING.md for the contributing guideline.

🤝 Acknowledgement 🔝

MMYOLO is an open source project that is contributed by researchers and engineers from various colleges and companies. We appreciate all the contributors who implement their methods or add new features, as well as users who give valuable feedback. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to re-implement existing methods and develop their own new detectors.

🖊️ Citation 🔝

If you find this project useful in your research, please consider citing:

@misc{mmyolo2022,
    title={{MMYOLO: OpenMMLab YOLO} series toolbox and benchmark},
    author={MMYOLO Contributors},
    howpublished = {\url{https://github.com/open-mmlab/mmyolo}},
    year={2022}
}

🎫 License 🔝

This project is released under the GPL 3.0 license.

🏗️ Projects in OpenMMLab 🔝

  • MMEngine: OpenMMLab foundational library for training deep learning models.
  • MMCV: OpenMMLab foundational library for computer vision.
  • MMPreTrain: OpenMMLab pre-training toolbox and benchmark.
  • MMagic: OpenMMLab Advanced, Generative and Intelligent Creation toolbox.
  • MMDetection: OpenMMLab detection toolbox and benchmark.
  • MMDetection3D: OpenMMLab's next-generation platform for general 3D object detection.
  • MMRotate: OpenMMLab rotated object detection toolbox and benchmark.
  • MMYOLO: OpenMMLab YOLO series toolbox and benchmark.
  • MMSegmentation: OpenMMLab semantic segmentation toolbox and benchmark.
  • MMOCR: OpenMMLab text detection, recognition, and understanding toolbox.
  • MMPose: OpenMMLab pose estimation toolbox and benchmark.
  • MMHuman3D: OpenMMLab 3D human parametric model toolbox and benchmark.
  • MMSelfSup: OpenMMLab self-supervised learning toolbox and benchmark.
  • MMRazor: OpenMMLab model compression toolbox and benchmark.
  • MMFewShot: OpenMMLab fewshot learning toolbox and benchmark.
  • MMAction2: OpenMMLab's next-generation action understanding toolbox and benchmark.
  • MMTracking: OpenMMLab video perception toolbox and benchmark.
  • MMFlow: OpenMMLab optical flow toolbox and benchmark.
  • MMEditing: OpenMMLab image and video editing toolbox.
  • MMGeneration: OpenMMLab image and video generative models toolbox.
  • MMDeploy: OpenMMLab model deployment framework.
  • MIM: MIM installs OpenMMLab packages.
  • MMEval: OpenMMLab machine learning evaluation library.
  • Playground: A central hub for gathering and showcasing amazing projects built upon OpenMMLab.

mmyolo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmyolo's Issues

验证安装时的提示

📚 The doc issue

用xshell连服务器安装MMYOLO,验证安装时提示如下,就停滞了

local loads checkpoint from path: yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth
/home/***/.conda/envs/open-mmlab/lib/python3.8/site-packages/mmengine/visualization/visualizer.py:170: UserWarning: Visualizer backend is not initialized because save_dir is None.
warnings.warn('Visualizer backend is not initialized '

Suggest a potential alternative/fix

No response

TypeError: only integer scalar arrays can be converted to a scalar index

Prerequisite

💬 Describe the reimplementation questions

When I want to replicate the performance of yolov5 and coco datasets on the window platform, the following error occurs:
TypeError: only integer scalar arrays can be converted to a scalar index

The detailed error information is as follows:
Traceback (most recent call last):
File "D:/pycharm_project/open-mmlab/mmyolo/tools/train.py", line 106, in
main()
File "D:/pycharm_project/open-mmlab/mmyolo/tools/train.py", line 102, in main
runner.train()
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmengine\runner\runner.py", line 1633, in train
model = self.train_loop.run() # type: ignore
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmengine\runner\loops.py", line 88, in run
self.run_epoch()
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmengine\runner\loops.py", line 103, in run_epoch
for idx, data_batch in enumerate(self.dataloader):
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmengine\dataset\base_dataset.py", line 408, in getitem
data = self.prepare_data(idx)
File "D:\pycharm_project\open-mmlab\mmyolo\mmyolo\datasets\yolov5_coco.py", line 57, in prepare_data
return self.pipeline(data_info)
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmengine\dataset\base_dataset.py", line 58, in call
data = t(data)
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmcv\transforms\base.py", line 11, in call
return self.transform(results)
File "D:\software\anaconda\envs\mmdetection\lib\site-packages\mmdet\datasets\transforms\formatting.py", line 96, in transform
results[key][valid_idx])
TypeError: only integer scalar arrays can be converted to a scalar index

Process finished with exit code 1

I would be grateful if you could answer this question.

Environment

sys.platform: win32
Python: 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3050 Ti Laptop GPU
CUDA_HOME: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5
NVCC: Cuda compilation tools, release 11.5, V11.5.50
MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.29.30146 版
GCC: n/a
PyTorch: 1.10.0+cu113
PyTorch compiling details: PyTorch built with:

  • C++ Version: 199711
  • MSVC 192829337
  • Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 2019
  • LAPACK is enabled (usually provided by MKL)
  • CPU capability usage: AVX2
  • CUDA Runtime 11.3
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.4
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=C:/w/b/windows/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/w/b/windows/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON,

TorchVision: 0.11.1+cu113
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+unknown

Process finished with exit code 0

Expected results

No response

Additional information

No response

Make pycocotools an optional dependency

Edit: Uninstalling and reinstalling pycocotools fixed the error.

What is the problem this feature will solve?

I run this code on env having mmengine, mmyolo, mmcv, mmdet installed:

from mmdet.apis import init_detector
from mmyolo.utils import register_all_modules

# register all modules in mmdet into the registries
register_all_modules()

# create model
config_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco.py'
model_path = 'yolov5_n-v61_syncbn_fast_8xb16-300e_coco_20220919_090739-b804c1ad.pth'

model = init_detector(
    config=config_path,
    checkpoint=model_path,
    device='cuda:0',
)

I get this error:

File .../lib/python3.8/site-packages/mmdet/apis/__init__.py:2, in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .inference import (async_inference_detector, inference_detector,
      3                         init_detector)
      5 __all__ = [
      6     'init_detector',
      7     'async_inference_detector',
      8     'inference_detector',
      9 ]

File .../lib/python3.8/site-packages/mmdet/apis/inference.py:14, in <module>
     11 from mmengine.config import Config
     12 from mmengine.runner import load_checkpoint
---> 14 from ..evaluation import get_classes
     15 from ..models import build_detector
     16 from ..structures import DetDataSample, SampleList

File .../lib/python3.8/site-packages/mmdet/evaluation/__init__.py:3, in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
      2 from .functional import *  # noqa: F401,F403
----> 3 from .metrics import *
...
----> 8 import pycocotools
      9 from pycocotools.coco import COCO as _COCO
     10 from pycocotools.cocoeval import COCOeval as _COCOeval

ModuleNotFoundError: No module named 'pycocotools'

Why is pycocotools a hard dependency for mmyolo? It is not necessary when doing only inference.

What is the feature you are proposing to solve the problem?

Making pycocotools dependency optional when doing inference with mmyolo model.

What alternatives have you considered?

No response

Try different method to fusion feature map.

What is the problem this feature will solve?

Maybe a new method to fusion feature map will enhance the performance of yolo.
In the course of my research on yolo, I found a problem: for example, in the yolov5 network, why is the feature map used for feature fusion output from the backbone part of these positions, but not the other positions? Or why did the other networks that used feature fusion choose to output feature maps from those locations and not others?

What is the feature you are proposing to solve the problem?

Would it be better to use the feature maps for feature fusion at other locations instead?

What alternatives have you considered?

No response

cspnext imagenet pretrained model in RTMDET

What is the problem this feature will solve?

What time will the cspnext pretrained model be relased in the page?
Like backbone in RTMDet-m、RTMDet-x、RTMDet-l?

What is the feature you are proposing to solve the problem?

backbone pretrained model in RTMDet.

What alternatives have you considered?

No response

EMA Hook Bug

# failed 
python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py --cfg-options load_from=yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth'


# success after add custom_hooks=None
python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py --cfg-options load_from=yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' custom_hooks=None
(mmyolo) ➜  mmyolo git:(main) ✗ python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py --cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth'
09/18 21:27:02 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "log_processor" registry tree. As a workaround, the current "log_processor" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
09/18 21:27:02 - mmengine - INFO - 
------------------------------------------------------------
System environment:
    sys.platform: linux
    Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
    CUDA available: True
    numpy_random_seed: 1122605154
    GPU 0: NVIDIA GeForce RTX 3060
    GPU 1: Quadro P2000
    CUDA_HOME: /usr/local/cuda-11.1
    NVCC: Cuda compilation tools, release 11.1, V11.1.74
    GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
    PyTorch: 1.12.1
    PyTorch compiling details: PyTorch built with:
  - GCC 9.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 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 11.3
  - 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  - CuDNN 8.3.2  (built against CUDA 11.5)
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/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 -Werror=cast-function-type -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
    OpenCV: 4.6.0
    MMEngine: 0.1.0

Runtime environment:
    cudnn_benchmark: True
    mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0}
    dist_cfg: {'backend': 'nccl'}
    seed: None
    Distributed launcher: none
    Distributed training: False
    GPU number: 1
------------------------------------------------------------

09/18 21:27:02 - mmengine - INFO - Config:
default_scope = 'mmyolo'
default_hooks = dict(
    timer=dict(type='IterTimerHook'),
    logger=dict(type='LoggerHook', interval=1),
    param_scheduler=dict(
        type='YOLOv5ParamSchedulerHook',
        scheduler_type='linear',
        lr_factor=0.01,
        max_epochs=300),
    checkpoint=dict(type='CheckpointHook', interval=10, max_keep_ckpts=3),
    sampler_seed=dict(type='DistSamplerSeedHook'),
    visualization=dict(type='mmdet.DetVisualizationHook'))
env_cfg = dict(
    cudnn_benchmark=True,
    mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
    dist_cfg=dict(backend='nccl'))
vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
    type='mmdet.DetLocalVisualizer',
    vis_backends=[dict(type='LocalVisBackend')],
    name='visualizer')
log_processor = dict(type='LogProcessor', window_size=50, by_epoch=True)
log_level = 'INFO'
load_from = 'yolov5-6.1/yolov5s.pth'
resume = False
file_client_args = dict(backend='disk')
data_root = 'data/balloon/'
dataset_type = 'YOLOv5CocoDataset'
img_scale = (640, 640)
deepen_factor = 0.33
widen_factor = 0.5
max_epochs = 300
save_epoch_intervals = 10
train_batch_size_per_gpu = 4
train_num_workers = 2
val_batch_size_per_gpu = 1
val_num_workers = 2
persistent_workers = True
batch_shapes_cfg = dict(
    type='BatchShapePolicy',
    batch_size=1,
    img_size=640,
    size_divisor=32,
    extra_pad_ratio=0.5)
anchors = [[(10, 13), (16, 30), (33, 23)], [(30, 61), (62, 45), (59, 119)],
           [(116, 90), (156, 198), (373, 326)]]
strides = [8, 16, 32]
model = dict(
    type='YOLODetector',
    data_preprocessor=dict(
        type='YOLOv5DetDataPreprocessor',
        mean=[0.0, 0.0, 0.0],
        std=[255.0, 255.0, 255.0],
        bgr_to_rgb=True),
    backbone=dict(
        type='YOLOv5CSPDarknet',
        deepen_factor=0.33,
        widen_factor=0.5,
        norm_cfg=dict(type='BN', momentum=0.03, eps=0.001),
        act_cfg=dict(type='SiLU', inplace=True)),
    neck=dict(
        type='YOLOv5PAFPN',
        deepen_factor=0.33,
        widen_factor=0.5,
        in_channels=[256, 512, 1024],
        out_channels=[256, 512, 1024],
        num_csp_blocks=3,
        norm_cfg=dict(type='BN', momentum=0.03, eps=0.001),
        act_cfg=dict(type='SiLU', inplace=True)),
    bbox_head=dict(
        type='YOLOv5Head',
        head_module=dict(
            type='YOLOv5HeadModule',
            num_classes=1,
            in_channels=[256, 512, 1024],
            widen_factor=0.5,
            featmap_strides=[8, 16, 32],
            num_base_priors=3),
        prior_generator=dict(
            type='mmdet.YOLOAnchorGenerator',
            base_sizes=[[(10, 13), (16, 30), (33, 23)],
                        [(30, 61), (62, 45), (59, 119)],
                        [(116, 90), (156, 198), (373, 326)]],
            strides=[8, 16, 32]),
        loss_cls=dict(
            type='mmdet.CrossEntropyLoss',
            use_sigmoid=True,
            reduction='mean',
            loss_weight=0.5),
        loss_bbox=dict(
            type='IoULoss',
            iou_mode='ciou',
            bbox_format='xywh',
            eps=1e-07,
            reduction='mean',
            loss_weight=0.05,
            return_iou=True),
        loss_obj=dict(
            type='mmdet.CrossEntropyLoss',
            use_sigmoid=True,
            reduction='mean',
            loss_weight=1.0),
        prior_match_thr=4.0,
        obj_level_weights=[4.0, 1.0, 0.4]),
    test_cfg=dict(
        multi_label=True,
        nms_pre=30000,
        score_thr=0.001,
        nms=dict(type='nms', iou_threshold=0.65),
        max_per_img=300))
albu_train_transforms = [
    dict(type='Blur', p=0.01),
    dict(type='MedianBlur', p=0.01),
    dict(type='ToGray', p=0.01),
    dict(type='CLAHE', p=0.01)
]
pre_transform = [
    dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
    dict(type='LoadAnnotations', with_bbox=True)
]
train_pipeline = [
    dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(
        type='Mosaic',
        img_scale=(640, 640),
        pad_val=114.0,
        pre_transform=[
            dict(
                type='LoadImageFromFile',
                file_client_args=dict(backend='disk')),
            dict(type='LoadAnnotations', with_bbox=True)
        ]),
    dict(
        type='YOLOv5RandomAffine',
        max_rotate_degree=0.0,
        max_shear_degree=0.0,
        scaling_ratio_range=(0.5, 1.5),
        border=(-320, -320),
        border_val=(114, 114, 114)),
    dict(
        type='mmdet.Albu',
        transforms=[
            dict(type='Blur', p=0.01),
            dict(type='MedianBlur', p=0.01),
            dict(type='ToGray', p=0.01),
            dict(type='CLAHE', p=0.01)
        ],
        bbox_params=dict(
            type='BboxParams',
            format='pascal_voc',
            label_fields=['gt_bboxes_labels', 'gt_ignore_flags']),
        keymap=dict(img='image', gt_bboxes='bboxes')),
    dict(type='YOLOv5HSVRandomAug'),
    dict(type='mmdet.RandomFlip', prob=0.5),
    dict(
        type='mmdet.PackDetInputs',
        meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
                   'flip_direction'))
]
train_dataloader = dict(
    batch_size=4,
    num_workers=2,
    persistent_workers=True,
    pin_memory=True,
    sampler=dict(type='DefaultSampler', shuffle=True),
    dataset=dict(
        type='YOLOv5CocoDataset',
        data_root='data/balloon/',
        ann_file='train.json',
        data_prefix=dict(img='train/'),
        filter_cfg=dict(filter_empty_gt=False, min_size=32),
        pipeline=[
            dict(
                type='LoadImageFromFile',
                file_client_args=dict(backend='disk')),
            dict(type='LoadAnnotations', with_bbox=True),
            dict(
                type='Mosaic',
                img_scale=(640, 640),
                pad_val=114.0,
                pre_transform=[
                    dict(
                        type='LoadImageFromFile',
                        file_client_args=dict(backend='disk')),
                    dict(type='LoadAnnotations', with_bbox=True)
                ]),
            dict(
                type='YOLOv5RandomAffine',
                max_rotate_degree=0.0,
                max_shear_degree=0.0,
                scaling_ratio_range=(0.5, 1.5),
                border=(-320, -320),
                border_val=(114, 114, 114)),
            dict(
                type='mmdet.Albu',
                transforms=[
                    dict(type='Blur', p=0.01),
                    dict(type='MedianBlur', p=0.01),
                    dict(type='ToGray', p=0.01),
                    dict(type='CLAHE', p=0.01)
                ],
                bbox_params=dict(
                    type='BboxParams',
                    format='pascal_voc',
                    label_fields=['gt_bboxes_labels', 'gt_ignore_flags']),
                keymap=dict(img='image', gt_bboxes='bboxes')),
            dict(type='YOLOv5HSVRandomAug'),
            dict(type='mmdet.RandomFlip', prob=0.5),
            dict(
                type='mmdet.PackDetInputs',
                meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
                           'flip', 'flip_direction'))
        ],
        metainfo=dict(CLASSES=('balloon', ), PALETTE=[(220, 20, 60)])),
    collate_fn=dict(type='yolov5_collate'))
test_pipeline = [
    dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
    dict(type='YOLOv5KeepRatioResize', scale=(640, 640)),
    dict(
        type='LetterResize',
        scale=(640, 640),
        allow_scale_up=False,
        pad_val=dict(img=114)),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(
        type='mmdet.PackDetInputs',
        meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
                   'scale_factor', 'pad_param'))
]
val_dataloader = dict(
    batch_size=1,
    num_workers=2,
    persistent_workers=True,
    pin_memory=True,
    drop_last=False,
    sampler=dict(type='DefaultSampler', shuffle=False),
    dataset=dict(
        type='YOLOv5CocoDataset',
        data_root='data/balloon/',
        test_mode=True,
        data_prefix=dict(img='val/'),
        ann_file='val.json',
        pipeline=[
            dict(
                type='LoadImageFromFile',
                file_client_args=dict(backend='disk')),
            dict(type='YOLOv5KeepRatioResize', scale=(640, 640)),
            dict(
                type='LetterResize',
                scale=(640, 640),
                allow_scale_up=False,
                pad_val=dict(img=114)),
            dict(type='LoadAnnotations', with_bbox=True),
            dict(
                type='mmdet.PackDetInputs',
                meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
                           'scale_factor', 'pad_param'))
        ],
        batch_shapes_cfg=dict(
            type='BatchShapePolicy',
            batch_size=1,
            img_size=640,
            size_divisor=32,
            extra_pad_ratio=0.5),
        metainfo=dict(CLASSES=('balloon', ), PALETTE=[(220, 20, 60)])))
test_dataloader = dict(
    batch_size=1,
    num_workers=2,
    persistent_workers=True,
    pin_memory=True,
    drop_last=False,
    sampler=dict(type='DefaultSampler', shuffle=False),
    dataset=dict(
        type='YOLOv5CocoDataset',
        data_root='data/balloon/',
        test_mode=True,
        data_prefix=dict(img='val/'),
        ann_file='val.json',
        pipeline=[
            dict(
                type='LoadImageFromFile',
                file_client_args=dict(backend='disk')),
            dict(type='YOLOv5KeepRatioResize', scale=(640, 640)),
            dict(
                type='LetterResize',
                scale=(640, 640),
                allow_scale_up=False,
                pad_val=dict(img=114)),
            dict(type='LoadAnnotations', with_bbox=True),
            dict(
                type='mmdet.PackDetInputs',
                meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
                           'scale_factor', 'pad_param'))
        ],
        batch_shapes_cfg=dict(
            type='BatchShapePolicy',
            batch_size=1,
            img_size=640,
            size_divisor=32,
            extra_pad_ratio=0.5),
        metainfo=dict(CLASSES=('balloon', ), PALETTE=[(220, 20, 60)])))
param_scheduler = None
optim_wrapper = dict(
    type='OptimWrapper',
    optimizer=dict(
        type='SGD',
        lr=0.01,
        momentum=0.937,
        weight_decay=0.0005,
        nesterov=True,
        batch_size_per_gpu=16),
    constructor='YOLOv5OptimizerConstructor')
custom_hooks = [
    dict(
        type='EMAHook',
        ema_type='ExpMomentumEMA',
        momentum=0.0001,
        update_buffers=True,
        priority=49)
]
val_evaluator = dict(
    type='mmdet.CocoMetric',
    proposal_nums=(100, 1, 10),
    ann_file='data/balloon/val.json',
    metric='bbox')
test_evaluator = dict(
    type='mmdet.CocoMetric',
    proposal_nums=(100, 1, 10),
    ann_file='data/balloon/val.json',
    metric='bbox')
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=300, val_interval=10)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
metainfo = dict(CLASSES=('balloon', ), PALETTE=[(220, 20, 60)])
launcher = 'none'
work_dir = './work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon'

Result has been saved to /project/openmmlab2/mmyolo/work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon/modules_statistic_results.json
09/18 21:27:03 - mmengine - INFO - Distributed training is not used, all SyncBatchNorm (SyncBN) layers in the model will be automatically reverted to BatchNormXd layers if they are used.
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
local loads checkpoint from path: yolov5-6.1/yolov5s.pth
09/18 21:27:04 - mmengine - WARNING - There is no `ema_state_dict` in checkpoint. `EMAHook` will make a copy of `state_dict` as the initial `ema_state_dict`
Traceback (most recent call last):
  File "tools/train.py", line 106, in <module>
    main()
  File "tools/train.py", line 102, in main
    runner.train()
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1623, in train
    self.load_or_resume()
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1585, in load_or_resume
    self.load_checkpoint(self._load_from)
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1977, in load_checkpoint
    self.call_hook('after_load_checkpoint', checkpoint=checkpoint)
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1693, in call_hook
    getattr(hook, fn_name)(self, **kwargs)
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/hooks/ema_hook.py", line 187, in after_load_checkpoint
    self.ema_model.module.load_state_dict(
  File "/home/elaine/miniconda3/envs/mmyolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for YOLODetector:
        size mismatch for bbox_head.head_module.convs_pred.0.weight: copying a param with shape torch.Size([255, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([18, 128, 1, 1]).
        size mismatch for bbox_head.head_module.convs_pred.0.bias: copying a param with shape torch.Size([255]) from checkpoint, the shape in current model is torch.Size([18]).
        size mismatch for bbox_head.head_module.convs_pred.1.weight: copying a param with shape torch.Size([255, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([18, 256, 1, 1]).
        size mismatch for bbox_head.head_module.convs_pred.1.bias: copying a param with shape torch.Size([255]) from checkpoint, the shape in current model is torch.Size([18]).
        size mismatch for bbox_head.head_module.convs_pred.2.weight: copying a param with shape torch.Size([255, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([18, 512, 1, 1]).
        size mismatch for bbox_head.head_module.convs_pred.2.bias: copying a param with shape torch.Size([255]) from checkpoint, the shape in current model is torch.Size([18]).

Best Ckpt Removing Raises Exception and stalls training

Prerequisite

🐞 Describe the bug

As said in the title, training stops at exception.

In mmengine/fileio/backends/local_backend.py, line 416, I've changed into following to temp fix it.

        try:
            if not self.exists(filepath):
                raise FileNotFoundError(f'filepath {filepath} does not exist')

            if self.isdir(filepath):
                raise IsADirectoryError('filepath should be a file')
        except:
            print("not exist!!!", filepath)

        try:
            os.remove(filepath)
        except:
            print("already removed!!!", filepath)

Environment

sys.platform: linux
Python: 3.8.13 (default, Oct 21 2022, 23:50:54) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3: Tesla V100-SXM2-32GB
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.0, V11.0.221
GCC: gcc (GCC) 5.4.0
PyTorch: 1.7.1+cu110
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 v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.0
  - 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
  - CuDNN 8.0.5
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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-variable -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

TorchVision: 0.8.2+cu110
OpenCV: 4.6.0
MMEngine: 0.3.0
MMCV: 2.0.0rc2
MMDetection: 3.0.0rc2
MMYOLO: 0.1.2+dc3377b

Additional information

I think it is due to removing best ckpt via multiprocessing so that it throws exception. Needs reviewing and fixing from dev side.

[Doc Request]

What is the problem this feature will solve?

There is no information on how to set up an experiment tracker in config for mmyolo.

What is the feature you are proposing to solve the problem?

Adding a section in docs showing how to set experiment trackers (Neptune, wandb etc.) in mmyolo config.

What alternatives have you considered?

No response

file format partition failure on Windows 10

Prerequisite

🐞 Describe the bug

File location: mmengine\config\config.py
Code line: line# 550
Code: file_format = filename.partition('.')[-1]
Bug: file format after partition is not 'py' but a file name.
Bug reason: the parameter 'filename' is a very long name with 2 dots inside.

Environment

sys.platform: win32
Python: 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)]
CUDA available: False
numpy_random_seed: 2147483648
MSVC: Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31107 for x64
GCC: n/a
PyTorch: 1.12.1
PyTorch compiling details: PyTorch built with:

  • C++ Version: 199711
  • MSVC 192829337
  • Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
  • OpenMP 2019
  • LAPACK is enabled (usually provided by MKL)
  • CPU capability usage: AVX2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CXX_COMPILER=C:/cb/pytorch_1000000000000/work/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/cb/pytorch_1000000000000/work/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=0, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF,

TorchVision: 0.13.1
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.0+5eb6094

Additional information

No response

Hope to add yolov5-pose

What is the problem this feature will solve?

I hope to add yolov5-pose

What is the feature you are proposing to solve the problem?

I hope to add yolov5-pose, I feel that it should be possible to directly return to the key point performance

What alternatives have you considered?

No response

the data dictionary has no key "inputs"

Prerequisite

🐞 Describe the bug

mmdet3.0里的DetDataPreprocessor,会在接收的参数"data"里直接取一个关键字"inputs",但从
YOLOv5CocoDataset一路跟到BaseDataset也没看见这个"inputs"是什么时候填进去的。所以跑到DetDataPreprocessor.forward()就跪

Environment

sys.platform: linux
Python: 3.8.0 (default, Nov 6 2019, 21:49:08) [GCC 7.3.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: NVIDIA GeForce RTX 3090
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.1, V11.1.105
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.10.1+cu111
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.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.1
  • 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
  • CuDNN 8.0.5
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.2+cu111
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+

Additional information

No response

"ValueError: not enough values to unpack(expected 2, got 0)" when training

Prerequisite

🐞 Describe the bug

I use coco train2017 dataset to train yolov5 in a single titan xp gpu, my config file is the official "yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py". And this error occurred when the first training epoch is finished, so I guess this problem may occurred when packing the pt weight file. The detailed error info is as follows:

10/05 16:07:06 - mmengine - [4m[37mINFO[0m - Epoch(train) [1][7250/7393] lr: 3.2684e-03 eta: 7 days, 14:59:43 time: 0.2958 data_time: 0.0012 memory: 5200 loss_cls: 1.2465 loss_obj: 1.3546 loss_bbox: 1.2261 loss: 3.8272
10/05 16:07:21 - mmengine - [4m[37mINFO[0m - Epoch(train) [1][7300/7393] lr: 3.2910e-03 eta: 7 days, 14:58:42 time: 0.2950 data_time: 0.0010 memory: 5200 loss_cls: 1.2226 loss_obj: 1.3625 loss_bbox: 1.2239 loss: 3.8091
10/05 16:07:36 - mmengine - [4m[37mINFO[0m - Epoch(train) [1][7350/7393] lr: 3.3135e-03 eta: 7 days, 14:57:19 time: 0.2935 data_time: 0.0010 memory: 5200 loss_cls: 1.2308 loss_obj: 1.3674 loss_bbox: 1.2283 loss: 3.8264
10/05 16:07:51 - mmengine - [4m[37mINFO[0m - Exp name: yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20221005_153017

Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/torch/utils/data/_utils/pin_memory.py", line 28, in _pin_memory_loop
idx, data = r
ValueError: not enough values to unpack (expected 2, got 0)
Traceback (most recent call last):
File "tools/train.py", line 106, in
main()
File "tools/train.py", line 102, in main
runner.train()
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1631, in train
model = self.train_loop.run() # type: ignore
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 88, in run
self.run_epoch()
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 103, in run_epoch
for idx, data_batch in enumerate(self.dataloader):
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 349, in iter
self._iterator._reset(self)
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 852, in _reset
data = self._get_data()
File "/home/amax/anaconda3/envs/openmmlab2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1029, in _get_data
raise RuntimeError('Pin memory thread exited unexpectedly')
RuntimeError: Pin memory thread exited unexpectedly

Environment

sys.platform: linux
Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3: TITAN X (Pascal)
CUDA_HOME: /usr/local/cuda-10.1
NVCC: Cuda compilation tools, release 10.1, V10.1.10
GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
PyTorch: 1.7.1+cu101
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 v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.1
  • 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
  • CuDNN 7.6.3
  • Magma 2.5.2
  • Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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-variable -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.8.2+cu101
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+59f3d30

Additional information

No response

Got all evaluation results -1 on custom dateset.

Prerequisite

💬 Describe the reimplementation questions

I tried to train my own data using Yolov5, however, in every validation stage, I got following results, all of them are -1.

Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = -1.000
...
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
11/08 16:40:01 - mmengine - INFO - bbox_mAP_copypaste: -1.000 -1.000 -1.000 -1.000 -1.000 -1.000

I use my training data for validation and it's the same, so I dont think it's due to a bad training;
I checked my label.json, the area is normal;

Here is my config, Im new to openMMLab, so I only changed a little from tutorial of balloon det, and also there's only 1 category in my data.

base = './yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py'
data_root = '../Dataset/uf_easy/'
img_scale = (640, 640)
deepen_factor = 0.33
widen_factor = 0.5
max_epochs = 300

metainfo = {
'CLASSES': ('uf', ),
'PALETTE': [
(220, 20, 60),
]
}

train_dataloader = dict(
batch_size=train_batch_size_per_gpu,
num_workers=train_num_worker,
dataset=dict(
data_root=data_root,
metainfo=metainfo,
data_prefix=dict(img='train/'),
ann_file='train.json'))
val_dataloader = dict(
batch_size=train_batch_size_per_gpu,
num_workers=train_num_worker,
dataset=dict(
data_root=data_root,
metainfo=metainfo,
data_prefix=dict(img='train/'),
ann_file='train.json'))
test_dataloader = val_dataloader
val_evaluator = dict(ann_file=data_root + 'train.json')
test_evaluator = val_evaluator
model = dict(bbox_head=dict(head_module=dict(num_classes=1)))

Environment

TorchVision: 0.10.0+cu111
OpenCV: 4.5.3
MMEngine: 0.1.0

Expected results

No response

Additional information

No response

Call for YOLOv5_x pretrained model

Model/Dataset description

As the title

Open source status

  • The model implementation is available
  • The model weights are available.

Provide useful links for the implementation

No response

yolov5 data augumentation missing!

📚 The doc issue

请问下
1 yolov5或v6 训练的时候,采用了哪些数据增广呢?是否有针对不同的物体或者人 检测框box 尺寸和大小随机调整的数据增广呢? 具体文档链接是?
2 就是说假如前面输入的人检测出来的box 比人要大的多而且尺寸 宽高比也很异常,那么这种情况的数据增广是怎么处理的呢? 具体代码体现在哪个地方呢? 具体代码位置是?

Suggest a potential alternative/fix

just follow

[Attention] Be an early contributor to MMYOLO!

Discussed in #123

Originally posted by vansin October 1, 2022

Guide

please create pull requests to dev branch

https://mmcv.readthedocs.io/zh_CN/latest/community/pr.html

Task List

Easy Task

task 1.1

  • change mmdet to mmyolo in docstring. #221

https://github.com/open-mmlab/mmyolo/blob/main/mmyolo/utils/setup_env.py

image

task 1.2

  • add mmeval to README.md and README_zh-CN.md. #221

mmeval

(1) In README.md:
MMEval: OpenMMLab machine learning evaluation library.

(2) In README_zh-CN.md:
MMEval: OpenMMLab 机器学习算法评测库

自适应batchsize的功能 (Adaptive batchsize function)

What is the problem this feature will solve?

根据显存大小自适应 batch-size 大小

Adaptive batch-size based on video memory size

What is the feature you are proposing to solve the problem?

根据显存大小自适应 batch-size 大小

Adaptive batch-size based on video memory size

What alternatives have you considered?

No response

could not find the checkpoint of yolov7

Model/Dataset description

Could you offer me the checkpoint of yolov7?

Open source status

  • The model implementation is available
  • The model weights are available.

Provide useful links for the implementation

No response

Hi I am just wondering I don't understand reduce layer and build layer purpose in your code what does it really mean? in the diagram I really do not get it topdown layer, out layer (0,1,2).

Prerequisite

💬 Describe the reimplementation questions

NONE

Environment

NONE

Expected results

No response

Additional information

No response

How to convert RTMDet to onnx?

What is the problem this feature will solve?

What is the feature you are proposing to solve the problem?

What alternatives have you considered?

No response

For small and occluded objects

Hi, thank you for your amazing work.I just want to ask that this algo can able to detect small or occluded objects(just one class)? if not then can we add self attention mechanism in this algo?.

The problem of loading pre-trained models in multiple GPU training

Prerequisite

🐞 Describe the bug

bash tools/dist_train.sh configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py 2 --cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' model.backbone.frozen_stages=4
outputs:
11/07 16:55:40 - mmengine - INFO - Epoch(train) [1][1/2730] lr: 0.0000e+00 eta: 81 days, 10:12:59 time: 8.5900 data_time: 7.5419 memory: 2460 loss: 8.3048 loss_cls: 5.7765 loss_obj: 0.5974 loss_bbox: 1.9309
Traceback (most recent call last):
File "/media/sdb1/bcy/code/mmyolo-main0.1.2/tools/train.py", line 106, in
main()
File "/media/sdb1/bcy/code/mmyolo-main0.1.2/tools/train.py", line 102, in main
runner.train()
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/runner.py", line 1661, in train
model = self.train_loop.run() # type: ignore
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 90, in run
self.run_epoch()
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 106, in run_epoch
self.run_iter(idx, data_batch)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 122, in run_iter
outputs = self.runner.model.train_step(
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/model/wrappers/distributed.py", line 121, in train_step
losses = self._run_forward(data, mode='loss')
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/model/wrappers/distributed.py", line 161, in _run_forward
results = self(**data, mode=mode)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 873, in forward
if torch.is_grad_enabled() and self.reducer._rebuild_buckets():
RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True to torch.nn.parallel.DistributedDataParallel, and by
making sure all forward function outputs participate in calculating loss.
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's forward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dict, iterable).
Parameter indices which did not receive grad for rank 0: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
In addition, you can set the environment variable TORCH_DISTRIBUTED_DEBUG to either INFO or DETAIL to print out information about which particular parameters did not receive gradient on this rank as part of this error
Traceback (most recent call last):
File "/media/sdb1/bcy/code/mmyolo-main0.1.2/tools/train.py", line 106, in
main()
File "/media/sdb1/bcy/code/mmyolo-main0.1.2/tools/train.py", line 102, in main
runner.train()
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/runner.py", line 1661, in train
model = self.train_loop.run() # type: ignore
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 90, in run
self.run_epoch()
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 106, in run_epoch
self.run_iter(idx, data_batch)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/runner/loops.py", line 122, in run_iter
outputs = self.runner.model.train_step(
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/model/wrappers/distributed.py", line 121, in train_step
losses = self._run_forward(data, mode='loss')
File "/home/lab532/anaconda3/lib/python3.9/site-packages/mmengine/model/wrappers/distributed.py", line 161, in _run_forward
results = self(**data, mode=mode)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 873, in forward
if torch.is_grad_enabled() and self.reducer._rebuild_buckets():
RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True to torch.nn.parallel.DistributedDataParallel, and by
making sure all forward function outputs participate in calculating loss.
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's forward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dict, iterable).
Parameter indices which did not receive grad for rank 1: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
In addition, you can set the environment variable TORCH_DISTRIBUTED_DEBUG to either INFO or DETAIL to print out information about which particular parameters did not receive gradient on this rank as part of this error
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 12373) of binary: /home/lab532/anaconda3/bin/python
Traceback (most recent call last):
File "/home/lab532/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/lab532/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/launch.py", line 193, in
main()
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/run.py", line 710, in run
elastic_launch(
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 131, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home/lab532/anaconda3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 259, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

tools/train.py FAILED

Failures:
[1]:
time : 2022-11-07_16:55:46
host : lab532-All-Series
rank : 1 (local_rank: 1)
exitcode : 1 (pid: 12374)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

Root Cause (first observed failure):
[0]:
time : 2022-11-07_16:55:46
host : lab532-All-Series
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 12373)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

Environment

fatal: not a git repository (or any parent up to mount point /media)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
sys.platform: linux
Python: 3.9.12 (main, Apr 5 2022, 06:56:58) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1: NVIDIA GeForce GTX 1080 Ti
CUDA_HOME: /usr/local/cuda:/usr/local/cuda
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PyTorch: 1.10.1+cu111
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.1
  • 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
  • CuDNN 8.0.5
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.2+cu111
OpenCV: 4.6.0
MMEngine: 0.3.0
MMCV: 2.0.0rc2
MMDetection: 3.0.0rc2
MMYOLO: 0.1.2+

Additional information

No response

How to Train RTMDet on a Custom Dataset

Model/Dataset description

Need a step-by-step toturial, better to support yolo-style *.txt format.

Open source status

  • The model implementation is available
  • The model weights are available.

Provide useful links for the implementation

No response

Roadmap of MMYOLO

We keep this issue open to collect feature requests from users and hear your voice. Our monthly release plan is also available here.

You can either:

  1. Suggest a new feature by leaving a comment.
  2. Vote for a feature request with +1 or be against with -1. (Remember that developers are busy and cannot respond to all feature requests, so vote for your most favorable one!)
  3. Tell us that you would like to help implement one of the features in the list or review the PRs. (This is the greatest things to hear about!)

V0.5.0(2023.1)

  • code
    • Support YOLOv8 instance seg (YOLOv8 支持实例分割)
    • Added a script to verify whether the installation was successful (新增快速验证是否安装成功的脚本) #487

V0.2.0(2022.11)

  • code
    • Support YOLOv6 MLX model(支持 YOLOV6 MLX 模型) #265
    • Align PPYOLOE training mAP(对齐 PPYOLOE 训练精度) #259
    • Align YOLOv7 training mAP(对齐 YOLOv7 训练精度) #243 #310
    • Support Grad-free CAM and Grad-based CAM(支持 Grad-based CAM 和 Grad-free CAM) #234
    • Integrate sahi repo (集成 sahi) #230 #284
    • Added a script to verify whether the installation was successful (新增快速验证是否安装成功的脚本) #277
    • demo/featmap_vis_demo.py script supports input image folder and url reference demo/demo_image.py (参考 demo/demo_image.py 脚本 为 demo/featmap_vis_demo.py 支持文件夹和 url 输入) #248
    • Support the use of existing models to export label files in labelme format (支持使用已有模型导出 labelme 格式的标签文件) #288
    • Refer to browse_dataset of mmcls to implement similar functionality in MMYOLO (参考 mmcls 的 browse_dataset 在 MMYOLO 中实现类似功能) #304
    • Support image_demo.py influence result formate to labelme label files(支持 image_demo.py 结果导出 labelme 格式的标签文件) #288
    • Support labelme label to COCO (支持 labelme 标签转 COCO) #308
    • Support big COCO annotation file split into train + val + test or trainval + test annotation files (支持划分大的 COCO 标签文件为 train + val + testtrainval + test 标签文件) #311
    • Added analysis script to automatically print registered modules in OpenMMLab (新增分析脚本自动打印 OpenMMLab 中已经注册的模块)
    • Compare the difference in inference speed between official YOLOv5 and YOLOv5 in MMYOLO under trt fp32 (对比官方 YOLOv5 和 MMYOLO 中 YOLOv5 在 trt fp32 下的推理速度差异)
    • Added accelerated video inference script (新增加速后的视频推理脚本)
    • Support ignore instance in YOLOv5(YOLOv5 支持 ignore instance 功能)
    • dataset or pipeline supports loading all datasets at once (dataset 或者 pipeline 支持一次性加载全部数据集)-实验性做法
  • doc
    • Added overview documentation of Algorithm principles and implementation with YOLOv6 (新增 YOLOv6 原理和实现详解文档概览) #252
    • Added YOLOv5 P6 1280 large resolution model structure diagram and brief description (新增 YOLOv5 P6 1280 大分辨率模型结构图和简要描述) #273
    • Customized dataset training+deployment full process document (自定义数据集 训练+部署 全流程文档) #306
    • Add module description documentation and provide a list of all available plug-in modules (新增一个模块描述文档并提供所有可用插件模块列表) #246
    • Added YOLOv5+ ResNet50 Self-supervised training with mmselfsup for weighted in How-to documents (How-to 新增 YOLOv5+ ResNet50 使用 mmselfsup 自监督训练的权重文档) #291
    • Optimize and improve deployment-related documentation (优化和完善部署相关文档)
    • Added documentation of how to use mim to call mmdet or other mm series repo script (新增如何通过 mim 跨库调用其他 OpenMMLab 脚本的文档) #321

Collected features

  • YOLO series supports input Any channel (YOLO 系列代码支持输入任意通道)
  • Adaptive batchsize function(支持自动 bs 计算功能) #141
  • Adaptive to anchor calculation(支持训练前自动anchor 聚类优化) #163

中文视频资源

汇总地址: https://github.com/open-mmlab/mmyolo/blob/dev/docs/zh_cn/article.md

工具类

序号 内容 视频 课程中的代码/文档
第1讲 特征图可视化 Link bilibili 特征图可视化文档
特征图可视化.ipynb
第2讲 基于 sahi 的大图推理 Link bilibili 10分钟轻松掌握大图推理.ipynb

基础类

序号 内容 视频 课程中的代码/文档
第1讲 配置全解读 Link bilibili 配置全解读文档
第2讲 工程文件结构简析 Linkbilibili 工程文件结构简析文档
🟩 第x讲 模型是如何构建的 - cfg 模式和 Registry 机制详解
🟩 第x讲 MMEngine 必备知识点梳理

实用类

序号 内容 视频 课程中的代码/文档
第1讲 源码阅读和调试「必备」技巧 Link bilibili 源码阅读和调试「必备」技巧文档
第2讲 10分钟换遍主干网络 Link bilibili 10分钟换遍主干网络文档
10分钟换遍主干网络.ipynb
第3讲 自定义数据集从标注到部署保姆级教程 Link bilibili 自定义数据集从标注到部署保姆级教程
第4讲 顶会第一步 · 模块自定义 Link bilibili 顶会第一步·模块自定义.ipynb
🟩 第x讲 关于 MMDet/MMYOLO 中可视化的一切
🟩 第x讲 关于组件随意组合那件事
🟩 第x讲 OpenMMLab 跨库调用全知道
🟩 第x讲 YOLOv5 自定义插件

源码解读类

序号 内容 视频 课程中的代码/文档
🟩 第x讲 RTMDet 原理和实现全解析
🟩 第x讲 YOLOv5 原理和实现全解析
🟩 第x讲 YOLOv6 原理和实现全解析
🟩 第x讲 YOLOv7 原理和实现全解析
🟩 第x讲 YOLOv8 原理和实现全解析
🟩 第x讲 PPYOLOE 原理和实现全解析

数据集分析脚本

What is the problem this feature will solve?

功能1 给定一个配置,画图显示类别和bbox实例个数的分布图,直接保存图片即可,不需要显示。
功能2 给定一个配置,画图显示类别和bbox wh的分布图,直接保存图片。
功能3 给定一个配置,画图显示类别和bbox wh比例分布图。
功能4 给点一个配置,基于coco划定的大中小物体规则 显示类别和wh面积分布图。

What is the feature you are proposing to solve the problem?

使用数据分析脚本,分析数据分布并直接生成分布图,让数据更加直观

What alternatives have you considered?

No response

Model convert fails for yolov5_x

Prerequisite

🐞 Describe the bug

Hi, I want to convert yolov5x.pt to mmyolo with
python tools/model_converters/yolov5_to_mmyolo.py --src ../models/yolov5x.pt --dst ../models/mmyolov5x.pt
But error occurs like this:

Traceback (most recent call last):
  File "tools/model_converters/yolov5_to_mmyolo.py", line 77, in <module>
    main()
  File "tools/model_converters/yolov5_to_mmyolo.py", line 73, in main
    convert(args.src, args.dst)
  File "tools/model_converters/yolov5_to_mmyolo.py", line 33, in convert
    yolov5_model = torch.load(src)['model']
  File "xxx/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/torch/serialization.py", line 607, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "xxx/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load
    result = unpickler.load()
  File "xxx/envs/mm2_cu11/lib/python3.8/site-packages/torch/serialization.py", line 875, in find_class
    return super().find_class(mod_name, name)
ModuleNotFoundError: No module named 'models'

Environment

My env list:

Package            Version   Editable project location
------------------ --------- ----------------------------------------------------------------------------------
addict             2.4.0
albumentations     1.0.1
certifi            2022.9.14
charset-normalizer 2.1.1
click              8.1.3
colorama           0.4.5
commonmark         0.9.1
contourpy          1.0.5
cycler             0.11.0
fonttools          4.37.3
idna               3.4
imageio            2.22.0
importlib-metadata 4.12.0
kiwisolver         1.4.4
Markdown           3.4.1
matplotlib         3.6.0
mkl-fft            1.3.1
mkl-random         1.2.2
mkl-service        2.4.0
mmcv               2.0.0rc1
mmdet              3.0.0rc1
mmengine           0.1.0
mmyolo             0.1.0     xxx/infra-mt-cvzoo-yolo
model-index        0.1.11
networkx           2.8.6
numpy              1.23.1
opencv-python      4.6.0.66
openmim            0.3.2
ordered-set        4.1.0
packaging          21.3
pandas             1.5.0
Pillow             9.2.0
pip                22.1.2
pycocotools        2.0.5
Pygments           2.13.0
pyparsing          3.0.9
python-dateutil    2.8.2
pytz               2022.2.1
PyWavelets         1.4.1
PyYAML             6.0
requests           2.28.1
rich               12.5.1
scikit-image       0.19.3
scipy              1.9.1
setuptools         63.4.1
six                1.16.0
tabulate           0.8.10
termcolor          2.0.1
terminaltables     3.1.10
tifffile           2022.8.12
torch              1.10.1
torchvision        0.11.2
tqdm               4.64.1
typing_extensions  4.3.0
urllib3            1.26.12
wheel              0.37.1
yapf               0.32.0
zipp               3.8.1

Additional information

No response

load_from conflicts with resume

Prerequisite

🐞 Describe the bug

I am training with COCO pretrained YOLOv5m model (specifying load_from=xxx in the config) on a custom dataset, after training for a while, the training stopped on exception. I now try with --resume to resume the training. It apparently loads load_from other than saved ckpt under work_dir. I now need to remove load_from from config to resume. So what is the suggested way to do this?

Traceback (most recent call last):
  File "tools/train.py", line 106, in <module>
    main()
  File "tools/train.py", line 102, in main
    runner.train()
  File "/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1653, in train
    self.load_or_resume()
  File "/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1599, in load_or_resume
    self.resume(resume_from)
  File "/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1954, in resume
    self.message_hub.load_state_dict(checkpoint['message_hub'])
KeyError: 'message_hub'
/anaconda3/envs/mm2_cu11/lib/python3.8/site-packages/mmengine/runner/runner.py:1948: UserWarning: The dataset metainfo from the resumed checkpoint is different from the current training dataset, please check the correctness of the checkpoint or the training dataset.

Environment

sys.platform: linux
Python: 3.8.13 (default, Oct 21 2022, 23:50:54) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3: Tesla V100-SXM2-32GB
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.0, V11.0.221
GCC: gcc (GCC) 5.4.0
PyTorch: 1.7.1+cu110
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 v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.0
  - 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
  - CuDNN 8.0.5
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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-variable -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

TorchVision: 0.8.2+cu110
OpenCV: 4.6.0
MMEngine: 0.3.0
MMCV: 2.0.0rc2
MMDetection: 3.0.0rc2
MMYOLO: 0.1.2+dc3377b

Additional information

No response

Error when excuting print_config.py

Prerequisite

🐞 Describe the bug

mim run mmdet print_config CONFIG_PATH

The execution of the following code raises an error as follows:

880d6e8c8b1b0084fccc53951e8c298

Environment

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
sys.platform: linux
Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: NVIDIA GeForce RTX 3090
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.1, V11.1.74
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX512
  • CUDA Runtime 11.3
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.2
  • 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.2
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+HEAD

Additional information

  1. Caused by the imcomplete modification of MMCV -> MMEngine.

mmyolo 0.1.0 rtmdet复现出错

Prerequisite

💬 Describe the reimplementation questions

使用dist_train.sh 多卡训练rtmdet时 会卡死 强行中断 显示多线程挂死 显存也没有打满 但是 执行train.py或者dist_train.sh 指定单卡是可以正常训练的,
yolox这个任务是正常的 问题出现在rtmdet 多卡上 请问这个问题怎么排查呢?

Environment

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
sys.platform: linux
Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: NVIDIA GeForce GTX TITAN X
CUDA_HOME: :/usr/local/cuda-10.2
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.12.1
PyTorch compiling details: PyTorch built with:

  • GCC 9.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 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 11.3
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.3.2 (built against CUDA 11.5)
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/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 -Werror=cast-function-type -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
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+

Expected results

No response

Additional information

No response

How to Freeze the Whole Backbone

What is the problem this feature will solve?

I think there are parameters that can freeze a layer or - 1 means that all layers are not frozen, and the whole backbone network is not frozen

What is the feature you are proposing to solve the problem?

I think there are parameters that can freeze a layer or - 1 means that all layers are not frozen, and the whole backbone network is not frozen

What alternatives have you considered?

No response

Could not use YOLOV5 P6 configs

Prerequisite

🐞 Describe the bug

Hi there,

I have been trying to make YOLOV5 P6 custom training pipeline working for a while. Unfortunately, I could not make it working. I used the same setting for P5 models, it worked well. Here are the settings I put:

_base_ = '../yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco.py'
# _base_ = '../yolov5_l-v61_syncbn_fast_8xb16-300e_coco.py'
data_root = '/mnt/ssd/datasets-ml/COTS_GoPro_1080_v3/'
train_batch_size_per_gpu = 2
train_num_workers = 6
num_classes = 1
metainfo = {
    'CLASSES': ('COTS', ),
    'PALETTE': [
        (220, 20, 60),
    ]
}
train_dataloader = dict(
    batch_size=train_batch_size_per_gpu,
    num_workers=train_num_workers,
    dataset=dict(
        data_root=data_root,
        metainfo=metainfo,
        data_prefix=dict(img=''),
        ann_file='mmdet_split_train.json'))
val_dataloader = dict(
    dataset=dict(
        data_root=data_root,
        metainfo=metainfo,
        data_prefix=dict(img=''),
        ann_file='mmdet_split_val.json',))
val_dataloader = dict(
    dataset=dict(
        data_root=data_root,
        metainfo=metainfo,
        data_prefix=dict(img=''),
        ann_file='mmdet_split_val.json'))
val_evaluator = dict(ann_file=data_root + 'mmdet_split_val.json')
test_evaluator = dict(ann_file=data_root + 'mmdet_split_test.json')
model = dict(bbox_head=dict(head_module=dict(num_classes=1)))
default_hooks = dict(logger=dict(interval=1))

With the base file: yolov5_l-v61_syncbn_fast_8xb16-300e_coco.py, the model can be trained. But with the base file: yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco.py, I got the following error messages:

11/09 19:05:34 - mmengine - WARNING - Failed to search registry with scope "mmyolo" in the "log_processor" registry tree. As a workaround, the current "log_processor" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized.
11/09 19:05:34 - mmengine - INFO -
System environment:
sys.platform: linux
Python: 3.8.13 (default, Oct 21 2022, 23:50:54) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 1934098022
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 2080 Ti
CUDA_HOME: /usr
NVCC: Cuda compilation tools, release 10.1, V10.1.24
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3

  • C++ Version: 201402

  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications

  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)

  • OpenMP 201511 (a.k.a. OpenMP 4.5)

  • LAPACK is enabled (usually provided by MKL)

  • NNPACK is enabled

  • CPU capability usage: AVX2

  • CUDA Runtime 11.3

  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37

  • CuDNN 8.2

  • Magma 2.5.2

  • 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

    TorchVision: 0.11.2
    OpenCV: 4.6.0
    MMEngine: 0.3.0

Runtime environment:
cudnn_benchmark: True
mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0}
dist_cfg: {'backend': 'nccl'}
seed: None
Distributed launcher: none
Distributed training: False
GPU number: 1

11/09 19:05:35 - mmengine - INFO - Config:
default_scope = 'mmyolo'
default_hooks = dict(
timer=dict(type='IterTimerHook'),
logger=dict(type='LoggerHook', interval=50),
param_scheduler=dict(
type='YOLOv5ParamSchedulerHook',
scheduler_type='linear',
lr_factor=0.01,
max_epochs=200),
checkpoint=dict(
type='CheckpointHook', interval=5, save_best='auto', max_keep_ckpts=3),
sampler_seed=dict(type='DistSamplerSeedHook'),
visualization=dict(type='mmdet.DetVisualizationHook'))
env_cfg = dict(
cudnn_benchmark=True,
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
dist_cfg=dict(backend='nccl'))
vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
type='mmdet.DetLocalVisualizer',
vis_backends=[dict(type='LocalVisBackend')],
name='visualizer')
log_processor = dict(type='LogProcessor', window_size=50, by_epoch=True)
log_level = 'INFO'
load_from = None
resume = False
file_client_args = dict(backend='disk')
data_root = 'data/coco/'
dataset_type = 'YOLOv5CocoDataset'
metainfo = dict(CLASSES=('COTS', ), PALETTE=[(220, 20, 60)])
num_classes = 1
img_scale = (1280, 1280)
deepen_factor = 1.0
widen_factor = 1.0
max_epochs = 200
save_epoch_intervals = 5
train_batch_size_per_gpu = 8
train_num_workers = 8
val_batch_size_per_gpu = 1
val_num_workers = 2
persistent_workers = True
batch_shapes_cfg = dict(
type='BatchShapePolicy',
batch_size=1,
img_size=1280,
size_divisor=32,
extra_pad_ratio=0.5)
anchors = [[(19, 27), (44, 40), (38, 94)], [(96, 68), (86, 152), (180, 137)],
[(140, 301), (303, 264), (238, 542)],
[(436, 615), (739, 380), (925, 792)]]
strides = [8, 16, 32, 64]
num_det_layers = 4
model = dict(
type='YOLODetector',
data_preprocessor=dict(
type='mmdet.DetDataPreprocessor',
mean=[0.0, 0.0, 0.0],
std=[255.0, 255.0, 255.0],
bgr_to_rgb=True),
backbone=dict(
type='YOLOv5CSPDarknet',
deepen_factor=1.0,
widen_factor=1.0,
norm_cfg=dict(type='BN', momentum=0.03, eps=0.001),
act_cfg=dict(type='SiLU', inplace=True)),
neck=dict(
type='YOLOv5PAFPN',
deepen_factor=1.0,
widen_factor=1.0,
in_channels=[256, 512, 768, 1024],
out_channels=[256, 512, 768, 1024],
num_csp_blocks=3,
norm_cfg=dict(type='BN', momentum=0.03, eps=0.001),
act_cfg=dict(type='SiLU', inplace=True)),
bbox_head=dict(
type='YOLOv5Head',
head_module=dict(
type='YOLOv5HeadModule',
num_classes=1,
in_channels=[256, 512, 768, 1024],
widen_factor=1.0,
featmap_strides=[8, 16, 32, 64],
num_base_priors=3),
prior_generator=dict(
type='mmdet.YOLOAnchorGenerator',
base_sizes=[[(19, 27), (44, 40), (38, 94)],
[(96, 68), (86, 152), (180, 137)],
[(140, 301), (303, 264), (238, 542)],
[(436, 615), (739, 380), (925, 792)]],
strides=[8, 16, 32, 64]),
loss_cls=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=0.004687500000000001),
loss_bbox=dict(
type='IoULoss',
iou_mode='ciou',
bbox_format='xywh',
eps=1e-07,
reduction='mean',
loss_weight=0.037500000000000006,
return_iou=True),
loss_obj=dict(
type='mmdet.CrossEntropyLoss',
use_sigmoid=True,
reduction='mean',
loss_weight=3.0),
prior_match_thr=4.0,
obj_level_weights=[4.0, 1.0, 0.4]),
test_cfg=dict(
multi_label=True,
nms_pre=30000,
score_thr=0.001,
nms=dict(type='nms', iou_threshold=0.65),
max_per_img=300))
albu_train_transforms = [
dict(type='Blur', p=0.01),
dict(type='MedianBlur', p=0.01),
dict(type='ToGray', p=0.01),
dict(type='CLAHE', p=0.01)
]
pre_transform = [
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
dict(type='LoadAnnotations', with_bbox=True)
]
train_pipeline = [
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
img_scale=(1280, 1280),
pad_val=114.0,
pre_transform=[
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk')),
dict(type='LoadAnnotations', with_bbox=True)
]),
dict(
type='YOLOv5RandomAffine',
max_rotate_degree=0.0,
max_shear_degree=0.0,
scaling_ratio_range=(0.5, 1.5),
border=(-640, -640),
border_val=(114, 114, 114)),
dict(
type='mmdet.Albu',
transforms=[
dict(type='Blur', p=0.01),
dict(type='MedianBlur', p=0.01),
dict(type='ToGray', p=0.01),
dict(type='CLAHE', p=0.01)
],
bbox_params=dict(
type='BboxParams',
format='pascal_voc',
label_fields=['gt_bboxes_labels', 'gt_ignore_flags']),
keymap=dict(img='image', gt_bboxes='bboxes')),
dict(type='YOLOv5HSVRandomAug'),
dict(type='mmdet.RandomFlip', prob=0.5),
dict(
type='mmdet.PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
'flip_direction'))
]
train_dataloader = dict(
batch_size=8,
num_workers=8,
persistent_workers=True,
pin_memory=True,
sampler=dict(type='DefaultSampler', shuffle=True),
dataset=dict(
type='YOLOv5CocoDataset',
data_root='data/coco/',
metainfo=dict(CLASSES=('COTS', ), PALETTE=[(220, 20, 60)]),
ann_file='mmdet_split_train.json',
data_prefix=dict(img=''),
filter_cfg=dict(filter_empty_gt=False, min_size=32),
pipeline=[
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk')),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Mosaic',
img_scale=(1280, 1280),
pad_val=114.0,
pre_transform=[
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk')),
dict(type='LoadAnnotations', with_bbox=True)
]),
dict(
type='YOLOv5RandomAffine',
max_rotate_degree=0.0,
max_shear_degree=0.0,
scaling_ratio_range=(0.5, 1.5),
border=(-640, -640),
border_val=(114, 114, 114)),
dict(
type='mmdet.Albu',
transforms=[
dict(type='Blur', p=0.01),
dict(type='MedianBlur', p=0.01),
dict(type='ToGray', p=0.01),
dict(type='CLAHE', p=0.01)
],
bbox_params=dict(
type='BboxParams',
format='pascal_voc',
label_fields=['gt_bboxes_labels', 'gt_ignore_flags']),
keymap=dict(img='image', gt_bboxes='bboxes')),
dict(type='YOLOv5HSVRandomAug'),
dict(type='mmdet.RandomFlip', prob=0.5),
dict(
type='mmdet.PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
'flip', 'flip_direction'))
]))
test_pipeline = [
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
dict(type='YOLOv5KeepRatioResize', scale=(1280, 1280)),
dict(
type='LetterResize',
scale=(1280, 1280),
allow_scale_up=False,
pad_val=dict(img=114)),
dict(type='LoadAnnotations', with_bbox=True, scope='mmdet'),
dict(
type='mmdet.PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
'scale_factor', 'pad_param'))
]
val_dataloader = dict(
batch_size=1,
num_workers=2,
persistent_workers=True,
pin_memory=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='YOLOv5CocoDataset',
data_root='data/coco/',
test_mode=True,
data_prefix=dict(img=''),
ann_file='mmdet_split_val.json',
pipeline=[
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk')),
dict(type='YOLOv5KeepRatioResize', scale=(1280, 1280)),
dict(
type='LetterResize',
scale=(1280, 1280),
allow_scale_up=False,
pad_val=dict(img=114)),
dict(type='LoadAnnotations', with_bbox=True, scope='mmdet'),
dict(
type='mmdet.PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
'scale_factor', 'pad_param'))
],
batch_shapes_cfg=dict(
type='BatchShapePolicy',
batch_size=1,
img_size=1280,
size_divisor=32,
extra_pad_ratio=0.5)))
test_dataloader = dict(
batch_size=1,
num_workers=2,
persistent_workers=True,
pin_memory=True,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='YOLOv5CocoDataset',
data_root='data/coco/',
test_mode=True,
data_prefix=dict(img=''),
ann_file='mmdet_split_test.json',
pipeline=[
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk')),
dict(type='YOLOv5KeepRatioResize', scale=(1280, 1280)),
dict(
type='LetterResize',
scale=(1280, 1280),
allow_scale_up=False,
pad_val=dict(img=114)),
dict(type='LoadAnnotations', with_bbox=True, scope='mmdet'),
dict(
type='mmdet.PackDetInputs',
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
'scale_factor', 'pad_param'))
],
batch_shapes_cfg=dict(
type='BatchShapePolicy',
batch_size=1,
img_size=1280,
size_divisor=32,
extra_pad_ratio=0.5)))
param_scheduler = None
optim_wrapper = dict(
type='OptimWrapper',
optimizer=dict(
type='SGD',
lr=0.01,
momentum=0.937,
weight_decay=0.0005,
nesterov=True,
batch_size_per_gpu=8),
constructor='YOLOv5OptimizerConstructor')
custom_hooks = [
dict(
type='EMAHook',
ema_type='ExpMomentumEMA',
momentum=0.0001,
update_buffers=True,
strict_load=False,
priority=49)
]
val_evaluator = dict(
type='mmdet.CocoMetric',
proposal_nums=(100, 1, 10),
ann_file='data/coco/mmdet_split_val.json',
metric='bbox')
test_evaluator = dict(
type='mmdet.CocoMetric',
proposal_nums=(100, 1, 10),
ann_file='data/coco/mmdet_split_test.json',
metric='bbox')
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=200, val_interval=5)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
launcher = 'none'
work_dir = './work_dirs/yolov5_l_cots'

Result has been saved to /mnt/ssd/code/CCIP/mmyolo/work_dirs/yolov5_l_cots/modules_statistic_results.json
Traceback (most recent call last):
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
obj = obj_cls(**args) # type: ignore
File "/mnt/ssd/code/CCIP/mmyolo/mmyolo/models/dense_heads/yolov5_head.py", line 197, in init
self.special_init()
File "/mnt/ssd/code/CCIP/mmyolo/mmyolo/models/dense_heads/yolov5_head.py", line 205, in special_init
assert len(self.obj_level_weights) == len(
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
obj = obj_cls(**args) # type: ignore
File "/mnt/ssd/code/CCIP/mmyolo/mmyolo/models/detectors/yolo_detector.py", line 41, in init
super().init(
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmdet/models/detectors/single_stage.py", line 35, in init
self.bbox_head = MODELS.build(bbox_head)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/registry.py", line 454, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 240, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 135, in build_from_cfg
raise type(e)(
AssertionError: class YOLOv5Head in mmyolo/models/dense_heads/yolov5_head.py:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/aslab/code/CCIP/mmyolo/tools/train.py", line 106, in
main()
File "/home/aslab/code/CCIP/mmyolo/tools/train.py", line 95, in main
runner = Runner.from_cfg(cfg)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 434, in from_cfg
runner = cls(
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 404, in init
self.model = self.build_model(model)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 803, in build_model
model = MODELS.build(model)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/registry.py", line 454, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 240, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/home/aslab/anaconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 135, in build_from_cfg
raise type(e)(
AssertionError: class YOLODetector in mmyolo/models/detectors/yolo_detector.py: class YOLOv5Head in mmyolo/models/dense_heads/yolov5_head.py:

Process finished with exit code 1


I set $PYTHONPATH to be the root path of mmyolo. The error message is not clear to me for debugging...
Also, I would like to know how I can solve this warning from mmegine: Failed to search registry with scope "mmyolo" in the "log_processor" registry tree. As a workaround, the current "log_processor" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmyolo" is a correct scope, or whether the registry is initialized. Any help would be greatly appreciated!

Best regards,
Yang

Environment

sys.platform: linux
Python: 3.8.13 (default, Oct 21 2022, 23:50:54) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 2080 Ti
CUDA_HOME: /usr/local/cuda-11.2
NVCC: Cuda compilation tools, release 11.2, V11.2.152
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.3
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.2
  • 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.11.2
OpenCV: 4.6.0
MMEngine: 0.3.0
MMCV: 2.0.0rc2
MMDetection: 3.0.0rc3
MMYOLO: 0.1.2+0b48313

Additional information

No response

关于模型部署的问题

mmyolo 环境依赖mmcv>=2.0.0rc1,<2.1.0,但是mmdeploy 环境依赖mmcv-full,目前mmcv-full最新版本为1.7.0。
使用mmdeploy进行torch2onnx时会提示mmcv版本过低,卸载mmcv-full==1.7.0用mmcv==2.0.0rc1,mmdeploy又会报错No module named 'mmcv.utils'。请问mmcv这个包依赖要怎么解决?

Maybe environmental problems

Prerequisite

🐞 Describe the bug

python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py
Traceback (most recent call last):
  File "tools/train.py", line 106, in <module>
    main()
  File "tools/train.py", line 56, in main
    register_all_modules(init_default_scope=False)
  File "/home/hpc/mmyolo/mmyolo/utils/setup_env.py", line 20, in register_all_modules
    import mmdet.visualization  # noqa: F401,F403
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/visualization/__init__.py", line 2, in <module>
    from .local_visualizer import DetLocalVisualizer
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/visualization/local_visualizer.py", line 12, in <module>
    from ..evaluation import INSTANCE_OFFSET
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/evaluation/__init__.py", line 3, in <module>
    from .metrics import *  # noqa: F401,F403
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/evaluation/metrics/__init__.py", line 3, in <module>
    from .coco_metric import CocoMetric
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/evaluation/metrics/coco_metric.py", line 15, in <module>
    from mmdet.datasets.api_wrappers import COCO, COCOeval
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/datasets/__init__.py", line 13, in <module>
    from .utils import get_loading_pipeline
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/datasets/utils.py", line 5, in <module>
    from mmdet.datasets.transforms import LoadAnnotations, LoadPanopticAnnotations
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/datasets/transforms/__init__.py", line 6, in <module>
    from .formatting import ImageToTensor, PackDetInputs, ToTensor, Transpose
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/datasets/transforms/formatting.py", line 9, in <module>
    from mmdet.structures.bbox import BaseBoxes
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/structures/bbox/__init__.py", line 2, in <module>
    from .base_boxes import BaseBoxes
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/structures/bbox/base_boxes.py", line 9, in <module>
    from mmdet.structures.mask.structures import BitmapMasks, PolygonMasks
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/structures/mask/__init__.py", line 3, in <module>
    from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks,
  File "/home/hpc/.local/lib/python3.8/site-packages/mmdet/structures/mask/structures.py", line 9, in <module>
    from mmcv.ops.roi_align import roi_align
  File "/home/hpc/.local/lib/python3.8/site-packages/mmcv/ops/__init__.py", line 2, in <module>
    from .active_rotated_filter import active_rotated_filter
  File "/home/hpc/.local/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in <module>
    ext_module = ext_loader.load_ext(
  File "/home/hpc/.local/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
    ext = importlib.import_module('mmcv.' + name)
  File "/usr/Anaconda3/envs/open-mmlab/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /home/hpc/.local/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor7is_cudaEv

一开始可以正常跑,后来可能更新的某些包,就一直报这个错

Environment

sys.platform: linux
Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 2080 Ti
CUDA_HOME: /usr/local/cuda-10.1
NVCC: Cuda compilation tools, release 10.1, V10.1.24
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX512
  • CUDA Runtime 11.3
  • 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_61,code=sm_61;-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;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.2
  • 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-variable -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.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.8.2+cu101
OpenCV: 4.6.0
MMEngine: 0.1.0
MMCV: 2.0.0rc1
MMDetection: 3.0.0rc1
MMYOLO: 0.1.1+db73593

Additional information

I have checked the version for cudatoolkit=10.1, but it doesn't work. Maybe cudatoolkit too low?

How to start with custom datasets?

What is the problem this feature will solve?

Hi~ I found that 'CustomDataset.py' used in original 'mmDet' is deprecated, as well as some optional parameters like 'classes'. Would you pls release a tutorial about how to train a yolov5 model with a custom dataset that possess different classes from coco.

What is the feature you are proposing to solve the problem?

Train YOLO model with custom datasets.

What alternatives have you considered?

No response

About yolox_head ‘batch_gt_instances_ignore’

What is the problem this feature will solve?

when I read yolox_head code I found parameter “batch_gt_instances_ignore”,but it is set to None,I haven't found how to use it in the code,I can get more of it?

What is the feature you are proposing to solve the problem?

about “batch_gt_instances_ignore”

What alternatives have you considered?

No response

add eval_metric.py file

Discussed in #281

Originally posted by wang-tf November 14, 2022
In original mmdet, there is a file named eval_metric.py. I think it's helpfull to analyse the model result. Will be added this file in future?

REQUEST: Refine zh_cn/algorithm_descriptions/yolov5_description.md

📚 The doc issue

Hi~

Lately, I have been working on the translation on the algorithm_descriptions/yolov5_description.md, however, I noticed that there are some small places in the Chinese version might need some refinement or modification. I considered revising them by myself, but of course, this will not be the same as what the original developers originally wanted to express.

Suggest a potential alternative/fix

No response

Whats the speed of other YOLOs you tested on NVIDIA 3090, and how about the speed of RTMDet on T4 / V100 ?

What is the problem this feature will solve?

Surprised to see the latest detector RTMDet, nice work.
But whats the speed of other yolos you tested on NVIDIA 3090, and how about the speed of RTMDet on T4 / V100 ?
You got other yolos' speed by testing mmyolo or their original repos ?
Thanks.

What is the feature you are proposing to solve the problem?

I want to know the speed of other yolos on NVIDIA 3090, and the speed of rtmdet on T4 / V100

What alternatives have you considered?

No response

raise KeyError(f'Cannot get key by value "{value}" of {cls}')

Prerequisite

🐞 Describe the bug

hello friends:

please check log as below:

python tools/deploy.py configs/mmdet/detection/detection_onnxruntime_static_O.py /home/ubuntu/PycharmProjects/MMDeploy/mmyolo/configs/yolox/yolox_s_8xb8-300e_coco.py /home/ubuntu/PycharmProjects/mdforpretrain/yolox_s_8xb8-300e_coco_20220917_030738-d7e60cb2.pth /home/ubuntu/PycharmProjects/mmpose-master/tests/data/coco/wanyubin-R-2_601272.jpg --work-dir mmdeploy_model/yolox_s_v2 --device cpu --dump-info
Traceback (most recent call last):
File "tools/deploy.py", line 448, in
main()
File "tools/deploy.py", line 130, in main
device=args.device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 407, in export2SDK
pipeline_info = get_pipeline(deploy_cfg, model_cfg, work_dir, device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 345, in get_pipeline
preprocess = get_preprocess(deploy_cfg, model_cfg, device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 219, in get_preprocess
pipeline = task_processor.get_preprocess()
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/codebase/mmdet/deploy/object_detection.py", line 294, in get_preprocess
model_cfg = process_model_config(self.model_cfg, [''], input_shape)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/codebase/mmdet/deploy/object_detection.py", line 53, in process_model_config
cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)
File "/home/ubuntu/anaconda3/envs/openmm37clone/lib/python3.7/site-packages/mmcv/utils/config.py", line 48, in getattr
raise ex
AttributeError: 'ConfigDict' object has no attribute 'data'

Environment

os:ubuntu18.04
python:3.7
2022-11-14 21:02:13,562 - mmdeploy - INFO - TorchVision: 0.11.3+cu113
2022-11-14 21:02:13,562 - mmdeploy - INFO - OpenCV: 4.6.0
2022-11-14 21:02:13,562 - mmdeploy - INFO - MMCV: 1.3.18
2022-11-14 21:02:13,562 - mmdeploy - INFO - MMCV Compiler: GCC 7.3
2022-11-14 21:02:13,562 - mmdeploy - INFO - MMCV CUDA Compiler: 11.3
2022-11-14 21:02:13,562 - mmdeploy - INFO - MMDeploy: 0.9.0+b6f8c1c
2022-11-14 21:02:13,562 - mmdeploy - INFO -

2022-11-14 21:02:13,562 - mmdeploy - INFO - Backend information
2022-11-14 21:02:14,177 - mmdeploy - INFO - onnxruntime: 1.8.1 ops_is_avaliable : True
2022-11-14 21:02:14,204 - mmdeploy - INFO - tensorrt: 8.4.3.1 ops_is_avaliable : False
2022-11-14 21:02:14,219 - mmdeploy - INFO - ncnn: 1.0.20221027 ops_is_avaliable : True

Additional information

no mater detection_onnxruntime_static.py of mmdeploy or mmyolo, is not ok.
for mmdeploy static.py, raise KeyError(f'Cannot get key by value "{value}" of {cls}')
KeyError: 'Cannot get key by value "mmyolo" of <enum 'Codebase'>'

for mmyolo static.py, raise
File "tools/deploy.py", line 130, in main
device=args.device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 407, in export2SDK
pipeline_info = get_pipeline(deploy_cfg, model_cfg, work_dir, device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 345, in get_pipeline
preprocess = get_preprocess(deploy_cfg, model_cfg, device)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/backend/sdk/export_info.py", line 219, in get_preprocess
pipeline = task_processor.get_preprocess()
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/codebase/mmdet/deploy/object_detection.py", line 294, in get_preprocess
model_cfg = process_model_config(self.model_cfg, [''], input_shape)
File "/home/ubuntu/PycharmProjects/MMDeploy/mmdeploy/codebase/mmdet/deploy/object_detection.py", line 53, in process_model_config
cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)
File "/home/ubuntu/anaconda3/envs/openmm37clone/lib/python3.7/site-packages/mmcv/utils/config.py", line 48, in getattr
raise ex
AttributeError: 'ConfigDict' object has no attribute 'data'

thanks.

查询模块脚本

What is the problem this feature will solve?

例如,想看下mmocr里面实现了哪些transformer,以方便我调用。

What is the feature you are proposing to solve the problem?

在OpenMMLab库里面的模块中,根据需求进行查询,并打印出结果。

What alternatives have you considered?

No response

sahi support in v0.2.0

What is the problem this feature will solve?

Related to this comment: #136 (comment)

I am wondering:

  • What is your implementation plan?
  • Do you want to include it as a tool or as a separate model?
  • How can I help you with this?

What is the feature you are proposing to solve the problem?

Applying sliced inference for large images (as satellite images) using https://github.com/obss/sahi.

I believe it would be better to add it as a tool since it can work on top of many object detection instance segmentation models.

Or maybe we can add it as an inference-only model and the model type can be customized from the config file.

@hhaAndroid @PeterH0323

[Feature Request] automatic lr schedule

What is the problem this feature will solve?

The original YOLOv5 repo calculates the learning rate and schedule automatically based on the given epoch number, batch size, and GPU count.

In MMYOLO, default lr is 0.01, but I assume it is calculated for 8 batch size x 8 GPU.

It is a manual effort to scale the lr in fine-tuning task when using N GPUs with M batch size per GPU.

What is the feature you are proposing to solve the problem?

Automatically calculating the lr using batch size and GPU count information.

What alternatives have you considered?

No response

Why yolox-s in mmyolo can be 40.8%(mAP)? However, official mAP of yolox-s is 40.5%?What you have modified?

Prerequisite

💬 Describe the reimplementation questions

Why yolox-s in mmyolo can be 40.8%(mAP)? However, official mAP of yolox-s is 40.5%?What you have modified?

Environment

nothing special

Expected results

No response

Additional information

No response

[Attention] Which is your most desired variant of the YOLO series?

MMYOLO Call for Proposals

在各个领域中 YOLO 系列改进算法众多,哪些改进的算法或者模块你觉得非常有用?欢迎在 Issue 中留言。我们会根据反馈列入开发计划当中。

Issue 回复模板

  • 算法名:
  • 发布的会议和年份(如有):
  • 论文(如有):
  • 数据集(如有):
  • 简介(如有):
  • 代码(如有):
  • 相关解读(如有):

示例


There are lots of improved algorithms in the YOLO series in various fields. Which improved algorithms or modules do you find useful? Feel free to leave your comments in the Issue. We will include them in the development plan based on the feedback.

Issue Reply Template

  • Algorithm Name:
  • Conference/Year(Optional):
  • Paper(Optional):
  • Datasets(Optional):
  • Introduction(Optional):
  • Repo(Optional):
  • Interpretations(Optional):

Example


根据大家反馈,我们会在下面维护一个列表,方便统一查看。
According to your feedback, we will maintain a list below.

Algorithm Name Conference/Year Paper Datasets Introduction Repo Interpretations
TPH-YOLOv5 ICCVW2021 link VisDrone2021 TPH/CBAM Official Zhihu1
YOLOV 2022 link IMAGENET VID and DET Official
Loss: EFL 2022 link LVIS v1 EFL Official Zhihu1
CFPNet 2022 link MS COCO Centralized Feature Pyramid for Object Detection Official mmyolo
YOLOP 2022 link BDD100K You Only Look at Once for Panoptic driving Perception Official Zhihu1
YOLO-Pose 2022 link COCO Keypoint Enhancing YOLO for Multi Person Pose Estimation Using Object Keypoint Similarity Loss Official Zhihu1
Edge-YOLO 2023 link COCO and Visdrone EdgeYOLO: An Edge-Real-Time Object Detector Official
YOLO-NAS 2023 MS COCO A Next-Generation, Object Detection Foundational Model generated by Deci’s Neural Architecture Search Technology Official Zhihu1
YOLO-MS 2023 link MS COCO Rethinking Multi-Scale Representation Learning for Real-time Object Detectionblock Official Weixin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.