I2C icon indicating copy to clipboard operation
I2C copied to clipboard

The complete scripts for training and evaluating I2C on CUB-200-2011 dataset and bugs

Open Sierkinhane opened this issue 3 years ago • 5 comments

Hi, Great thanks for your great work I2C.

When I ran the code, I met many problems. I have changed the code for training I2C on CUB-200-2011 dataset, however, I found that the obtained top1 and top 5 accuracies using the code in val_fram.py are surprisingly tensor(100,) and tensor(100.). Is that correct? And the code for computing the metric of Gt-Known, Top1 Loc, and Top5 Loc is not released in this repository.

Besides, there some bugs in this repository, for example, reduce_lr function used in https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/exper/train_frame.py#L134 is not existed in my_optim.py, and the ReaderCrossImage in mydataset_crsimg.py returns img_dat, onehot_label, label https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/utils/mydataset_crsimg.py#L137 in the getitem function, however, when enumerating the dataloader in train_fram.py, it gets img_path , img, label = dat. https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/exper/train_frame.py#L144

I would appreciate the author can release the complete training scripts for CUB-200-2011 dataset(including the hyper-parameters) and check the code whether it can successfully be executed on the device.

Sierkinhane avatar May 22 '21 02:05 Sierkinhane

Hi, Great thanks for your great work I2C.

When I ran the code, I met many problems. I have changed the code for training I2C on CUB-200-2011 dataset, however, I found that the obtained top1 and top 5 accuracies using the code in val_fram.py are surprisingly tensor(100,) and tensor(100.). Is that correct? And the code for computing the metric of Gt-Known, Top1 Loc, and Top5 Loc is not released in this repository.

Besides, there some bugs in this repository, for example, reduce_lr function used in

https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/exper/train_frame.py#L134

is not existed in my_optim.py, and the ReaderCrossImage in mydataset_crsimg.py returns img_dat, onehot_label, label https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/utils/mydataset_crsimg.py#L137

in the getitem function, however, when enumerating the dataloader in train_fram.py, it gets img_path , img, label = dat. https://github.com/xiaomengyc/I2C/blob/b4aeaa806ad6cebe5a349afcb33759755fa50ab6/exper/train_frame.py#L144

I would appreciate the author can release the complete training scripts for CUB-200-2011 dataset(including the hyper-parameters) and check the code whether it can successfully be executed on the device.

大佬 这个代码你最终跑通了吗?我最近也在尝试运行这个代码。我不多打扰您 ,只是想问下这个代码有复现的可能吗?

joe660 avatar Jun 22 '21 09:06 joe660

这个代码挺有问题的,很多错误,虽然后面我调好了 但是跑的结果很奇怪,坐等作者帮助

Sierkinhane avatar Jul 01 '21 11:07 Sierkinhane

这个代码挺有问题的,很多错误,虽然后面我调好了 但是跑的结果很奇怪,坐等作者帮助

想请教一下~请问您是否发现了在mydataset_crsimg.py中 用get_random_img函数成对选择图片在一个epoch中可能会出现图片重复和遗漏的问题,以及您是如何修复这一bug的?

def get_random_img(self, num_cls, num_img_each_cls):
    # print("cls:", num_cls, list(self.map_img_path.keys()))
    cls_list = random.sample(list(self.map_img_path.keys()), num_cls) # random sample without replacement
    img_list = []
    img_label_list = []
    img_cls_list = []
    for cls_nid in cls_list:
        sample_img_list = random.sample(self.map_img_path[cls_nid], num_img_each_cls) # random sample without replacement
        for single_item in sample_img_list:
            img_list.append(single_item['img_name'])
            img_label_list.append(single_item['label'])
            img_cls_list.extend([cls_nid,])

    return zip(img_list, img_label_list, img_cls_list)

qqqqxxyy avatar Jul 02 '21 07:07 qqqqxxyy

这个代码挺有问题的,很多错误,虽然后面我调好了 但是跑的结果很奇怪,坐等作者帮助

你好,obj_simi.obj_valid_inds(mask, obj_inds)中obj_simi.obj_valid_inds()函数在什么地方啊,我没有找到,方便的话可以指点一下

shi-10 avatar Jul 06 '21 06:07 shi-10

@xiaomengyc 还是坐等作者完善一下吧,[祈福]

Sierkinhane avatar Jul 06 '21 06:07 Sierkinhane