GithubHelp home page GithubHelp logo

AssertionError: The `num_classes` (80) in UniFormer of MMDistributedDataParallel does not matches the length of `CLASSES` 54) in CocoDataset about uniformer HOT 9 CLOSED

Williamlizl avatar Williamlizl commented on June 30, 2024
AssertionError: The `num_classes` (80) in UniFormer of MMDistributedDataParallel does not matches the length of `CLASSES` 54) in CocoDataset

from uniformer.

Comments (9)

Andy1621 avatar Andy1621 commented on June 30, 2024

Can you provide more details? If you run with your dataset, you need to change the num_classes.

from uniformer.

Williamlizl avatar Williamlizl commented on June 30, 2024

Can you provide more details? If you run with your dataset, you need to change the num_classes.

I have changed the num_class in the config py、\mmdet\datasets\coco.py、\mmdet\core\evaluation\class_names.py,
then I run python3.7 setup.py install, it still shows the error

from uniformer.

Andy1621 avatar Andy1621 commented on June 30, 2024

54 is the number of classes for your dataset? I guess you don't change the config correctly.
You can check the generated file (xxx.log) for training, and find whether you have already changed the num_class.
Can you provide the config that you run?

image

from uniformer.

Williamlizl avatar Williamlizl commented on June 30, 2024

Traceback (most recent call last): File "./tools/train.py", line 187, in <module> main() File "./tools/train.py", line 183, in main meta=meta) File "/home/lbc/UniFormer/object_detection/mmdet/apis/train.py", line 185, in train_detector runner.run(data_loaders, cfg.workflow) File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run epoch_runner(data_loaders[i], **kwargs) File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 45, in train self.call_hook('before_train_epoch') File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 307, in call_hook getattr(hook, fn_name)(self) File "/home/lbc/UniFormer/object_detection/mmdet/datasets/utils.py", line 150, in before_train_epoch self._check_head(runner) File "/home/lbc/UniFormer/object_detection/mmdet/datasets/utils.py", line 137, in _check_head (f'The num_classes` ({module.num_classes}) in '2022-02-23 16:06:53,711 - mmdet - INFO - Checkpoints will be saved to /home/lbc/UniFormer/object_detection/work_dirs/config by HardDiskBackend.

AssertionError: The num_classes (54) in ConvFCBBoxHead of MMDistributedDataParallel does not matches the length of CLASSES 80) in CocoDataset`
QQ截图20220222180015
QQ截图20220223162812——1
QQ截图20220223162835——2

from uniformer.

Williamlizl avatar Williamlizl commented on June 30, 2024

54 is the number of classes for your dataset? I guess you don't change the config correctly. You can check the generated file (xxx.log) for training, and find whether you have already changed the num_class. Can you provide the config that you run?

image

I check the log file, it does show the num_class=54, could you tell me which mmdetection edition you have used?

from uniformer.

Andy1621 avatar Andy1621 commented on June 30, 2024

@Williamlizl You can find the version in version.py. It is 2.11.0.
You can install the mmdet under our repo => UniFormer/object_detection/

from uniformer.

Andy1621 avatar Andy1621 commented on June 30, 2024

Moreover, could you share the detailed config and shell you run? Maybe you can open new repo and upload the config you use. I will check it.

from uniformer.

Williamlizl avatar Williamlizl commented on June 30, 2024

Moreover, could you share the detailed config and shell you run? Maybe you can open new repo and upload the config you use. I will check it.

Ok ,thank u

from uniformer.

Andy1621 avatar Andy1621 commented on June 30, 2024

Same issue in issue17.

from uniformer.

Related Issues (20)

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.