Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when testing the IMC-PT-SparseGM #65

Open
gtan45 opened this issue Jan 8, 2024 · 6 comments
Open

Issues when testing the IMC-PT-SparseGM #65

gtan45 opened this issue Jan 8, 2024 · 6 comments
Assignees

Comments

@gtan45
Copy link

gtan45 commented Jan 8, 2024

I tried to run the experiments related to IMC-PT-SparseGM dataset by executing "experiments/ngmv2-afat/vgg16_ngmv2-afat-u_imcpt_50_stage1.yaml".

When I run initially, I got the error "FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/pygmtools/data/IMC-PT-SparseGM.tar.gz'".

Then I updated the version of the pygmtools to version "0.4.3" and re-run. Then I got the following issue "AssertionError: you should not change ROOT_DIR_IMG or ROOT_DIR_NPZ unless the data have been manually downloaded".

Suggestions on how to fix the above issue and run the experiments related to IMC-PT-SparseGM dataset will be much appreciated.

@ziao-guo
Copy link
Contributor

ziao-guo commented Jan 8, 2024

Typically, the dataset is automatically downloaded. However, it seems that some issues are causing the dataset not to be downloaded correctly. You can provide more error information to help determine the cause of the issue.
Alternatively, you are recommended to manually download the dataset. See the homepage of IMC-PT-SparseGM here.
Download and unzip the dataset and make sure it looks like data/IMC-PT-SparseGM/annotations and data/IMC-PT-SparseGM/images.

@gtan45
Copy link
Author

gtan45 commented Mar 26, 2024

Thanks for the instructions. The dataset was downloaded as per the instructions and it was possible to run imcpt_50 dataset successfully. Thanks again.
However, when trying to run the imcpt_100 dataset the following error keep occurring. Suggestions on how to fix the error will be much appreciated.

KeyError Traceback (most recent call last)
/tmp/ipykernel_594776/3847300564.py in
17 cfg.TRAIN.CLASS if x == 'train' else cfg.EVAL.CLASS,
18 cfg.PROBLEM.TYPE)
---> 19 for x in ('train', 'test')}
20 dataloader = {x: get_dataloader(image_dataset[x], shuffle=True, fix_seed=(x == 'test'))
21 for x in ('train', 'test')}

/tmp/ipykernel_594776/3847300564.py in (.0)
17 cfg.TRAIN.CLASS if x == 'train' else cfg.EVAL.CLASS,
18 cfg.PROBLEM.TYPE)
---> 19 for x in ('train', 'test')}
20 dataloader = {x: get_dataloader(image_dataset[x], shuffle=True, fix_seed=(x == 'test'))
21 for x in ('train', 'test')}

ThinkMatch/src/dataset/data_loader.py in init(self, name, bm, length, using_all_graphs, cls, problem)
35 self.problem_type = problem
36 if problem != 'MGM3':
---> 37 self.img_num_list = self.bm.compute_img_num(self.classes)
38 else:
39 self.img_num_list = self.bm.compute_img_num(self.classes[0])

/opt/conda/lib/python3.7/site-packages/pygmtools/benchmark.py in compute_img_num(self, classes)
354 if self.name != 'SPair71k':
355 for id in data_id:
--> 356 if self.data_dict[id]['cls'] == clss:
357 cls_img_num += 1
358 num_list.append(cls_img_num)

KeyError: '70392907_4845953799'

@ziao-guo
Copy link
Contributor

It seems that something goes wrong in the data preprocessing stage.

Could you please provide the version of the pygmtools package you are using and how you run the imcpt_100 experiment? That will help detect the reason for the error.

@gtan45
Copy link
Author

gtan45 commented Mar 26, 2024

The pygmtools pakcage version is pygmtools==0.3.8. Also, the imcpt_100 experiment was tried to run using "python train_eval.py --cfg experiments/gcan-afat/vgg16_gcan-afat-i_imcpt_100_stage1.yaml". Thanks.

@ziao-guo
Copy link
Contributor

Thanks for the info, I found the problem.

Before you run the imcpt_100 experiment, you need to go to the data/IMC-PT-SparseGM directory and remove train.json and test.json, which are generated for imcpt_50. We will fix the bug in the later version of pygmtools.

Thanks for the issue!

@gtan45
Copy link
Author

gtan45 commented Mar 26, 2024

Thanks for the instructions and prompt reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants