GithubHelp home page GithubHelp logo

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

sense-x avatar sense-x commented on August 16, 2024
AssertionError: The `num_classes` (54) in ConvFCBBoxHead of MMDistributedDataParallel does not matches the length of `CLASSES` 80) in CocoDataset

from uniformer.

Comments (9)

Andy1621 avatar Andy1621 commented on August 16, 2024

It seems that you forget to change the num_classes in mask_head, and it loads from configs/_base_/models/cascade_mask_rcnn_uniformer_fpn.

mask_head=dict(
type='FCNMaskHead',
num_convs=4,
in_channels=256,
conv_out_channels=256,
num_classes=80,
loss_mask=dict(
type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))),

from uniformer.

Andy1621 avatar Andy1621 commented on August 16, 2024

Would you like to check all the num_classes in xxx.log? I guess one value for num_classes isn't set to 54.

from uniformer.

Williamlizl avatar Williamlizl commented on August 16, 2024

I check the log file, and all the num_classes in log file has been changed, but it still shows the error,,,,,

from uniformer.

Andy1621 avatar Andy1621 commented on August 16, 2024

@Williamlizl Have you changed the num_classes in mask_head ?

from uniformer.

Williamlizl avatar Williamlizl commented on August 16, 2024

@Williamlizl Have you changed the num_classes in mask_head ?

I have changed the num_classes, and the log file shows Ok, but it still could not work

from uniformer.

Andy1621 avatar Andy1621 commented on August 16, 2024

I think you should write dataset.py for your dataset, because you load the default file for COCO configs/base/datasets/coco_instance.py.
It will load the annotations of COCO, which consists of 80 classes.

from uniformer.

Andy1621 avatar Andy1621 commented on August 16, 2024

You can find it from

@DATASETS.register_module()
class CocoDataset(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat',
'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl',
'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop',
'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock',
'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush')

from uniformer.

Andy1621 avatar Andy1621 commented on August 16, 2024

As there is no more activity, I am closing the issue, don't hesitate to reopen it if necessary.

from uniformer.

Williamlizl avatar Williamlizl commented on August 16, 2024

You can find it from

@DATASETS.register_module()
class CocoDataset(CustomDataset):
CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat',
'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl',
'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop',
'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock',
'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush')

Thank you, I will try it

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.