hustvl / WeakTr

WeakTr: Exploring Plain Vision Transformer for Weakly-supervised Semantic Segmentation
MIT License
120 stars 2 forks source link

dimensional(_,B,C,H,W),what_means? #8

Closed rongtongxueya closed 9 months ago

rongtongxueya commented 1 year ago

Has anyone encountered dimension issues when running the code? For some reason, my x has become five-dimensional, with the shape (2, 4, 3, 224, 224). I can't figure out what the 2 means. _,B,C,H,W

Unrealluver commented 1 year ago

Could you please provide more details about that? E.g. which script do you run? You find that problem at which line of which file?

rongtongxueya commented 1 year ago

thanks for your reply.I have solved the problem.However, I encountered a new problem. I didn't quite understand the stored content in the SegmentationClassAug file. I tried to use the command in readme to reproduce the code, but I met this problem. class VOC12DatasetMS(Dataset): def init(self, img_name_list_path, data_root, scales, label_file_path="voc12/cls_labels.npy", train=True, transform=None, gen_attn=False, unit=1):

img_name_list_path = os.path.join(img_name_list_path, f'{"train_aug" if train or gen_attn else "val"}_id.txt')

    self.img_name_list = load_img_name_list(img_name_list_path)
    self.label_list = load_image_label_list_from_npy(self.img_name_list, label_file_path)
    data_root = Path(data_root) / "voc12" if "voc12" not in data_root else data_root
    self.data_root = Path(data_root) / "VOCdevkit" / "VOC2012"
    self.gt_dir = self.data_root / "SegmentationClassAug"
    self.transform = transform
    self.unit = unit
    self.scales = scales
Unrealluver commented 1 year ago

It seems that you only provide the code. Could you please provide the error message?

Unrealluver commented 9 months ago

I will close this issue. Please let me know if there still exists anything unclear.