dvlab-research / PanopticFCN

Fully Convolutional Networks for Panoptic Segmentation (CVPR2021 Oral)
Apache License 2.0
391 stars 53 forks source link

I met a problem; the setting of max number of instances of the same category #35

Closed AntonotnaWang closed 2 years ago

AntonotnaWang commented 2 years ago

To whom it may concern,

I met the following problem RuntimeError: The expanded size of the tensor (100) must match the existing size (119) at non-singleton dimension 0. Target sizes: [100, 182, 333]. Tensor sizes: [119, 182, 333]

May I ask is the above problem caused by the limitation of the max number of instances of the same category? Is the default setting is 100? For my own dataset, the number of instances of the same category ("cell") in one image is often more than 100.

Thanks a lot

Anton

AntonotnaWang commented 2 years ago

To whom it may concern,

I met the following problem RuntimeError: The expanded size of the tensor (100) must match the existing size (119) at non-singleton dimension 0. Target sizes: [100, 182, 333]. Tensor sizes: [119, 182, 333]

May I ask is the above problem caused by the limitation of the max number of instances of the same category? Is the default setting is 100? For my own dataset, the number of instances of the same category ("cell") in one image is often more than 100.

Thanks a lot

Anton

I managed to solve this problem by myself, It is because of the 15th line self.tensor_dim = cfg.MODEL.TENSOR_DIM in PanopticFCN/panopticfcn/gt_generate.py. cfg.MODEL.TENSOR_DIM seems to be 100. So it meant that the max number of instances of one category was 100.

yanwei-li commented 2 years ago

Dear Anton, thanks for your comment. You are right. The cfg.MODEL.TENSOR_DIM is used to indicate the max instance number. It varies with your dataset.