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

FileNotFoundError: [Errno 2] No such file or directory: 'data/imagenet/classnames.txt' #2

Closed
JiuqingDong opened this issue Jan 31, 2024 · 12 comments

Comments

@JiuqingDong
Copy link

JiuqingDong commented Jan 31, 2024

Dear Authors,

Could you tell me how can I find this file 'data/imagenet/classnames.txt'?
when I run the command, there is a error:FileNotFoundError: [Errno 2] No such file or directory: 'data/imagenet/classnames.txt'

https://github.com/xmartlabs/caffeflow/blob/master/examples/imagenet/imagenet-classes.txt
Can I use this one?

@AtsuMiyai
Copy link
Owner

AtsuMiyai commented Jan 31, 2024

@JiuqingDong Hi, thanks for your interest in our LoCoOp!
I follow the dataset setup of https://github.com/KaiyangZhou/CoOp/blob/main/DATASETS.md
You can download imagenet-classes.txt via https://drive.google.com/file/d/1-61f_ol79pViBFDG_IDlUQSwoLcn2XXF/view

@JiuqingDong
Copy link
Author

Thank you for your reply.

Yesterday, I used this file to evaluate the 16-shot pre-trained models you released. I got the average result as follows. Three results denote Seed 1, 2, and 3.
image

Then I used the file you gave me. I got the same results. However, these results are inconsistent with those shown in Table 1 of your paper. I'm not sure if I did something wrong.

image

I use the inference command 'CUDA_VISIBLE_DEVICES=0 bash scripts/locoop/eval.sh data imagenet vit_b16_ep50 1 output/imagenet/LoCoOp/vit_b16_ep50_16shots/nctx16_cscFalse_ctpend/seed1'

@AtsuMiyai
Copy link
Owner

Oh, it is strange. Could you give me the log file?

Seed1 result is:
MCM avg. FPR:0.3443744680851064, AUROC:0.9273575242446808, AUPR:0.9846419915753499
GL-MCM avg. FPR:0.2815491134751773, AUROC:0.9361394410159575, AUPR:0.9862216511729003

@JiuqingDong
Copy link
Author

log.txt

Here is the log file for Seed 1. Thank you so much.

@AtsuMiyai
Copy link
Owner

What is the performance using CoOp's ckpt?
https://drive.google.com/drive/folders/1eV3uJxxQ0hvY3JltwuXds_Qhr77QLfRe?usp=sharing

@JiuqingDong
Copy link
Author

log__.txt
This is the log file of CoOp.pth

The results I obtained seem to be inconsistent with those published in the paper. Did you modify the code?

@AtsuMiyai
Copy link
Owner

I think I do not change my code. (I'm going to check now, just to be sure.)
I don't think our paper score is wrong. For example, CoOp's OOD detection results on ImageNet are presented in another paper https://arxiv.org/pdf/2306.06048.pdf. And, the result (Fig.5) is very close to mine.

Could you check the Dataset setup, etc.? Besides, you can MCM repo to check your datasets are correct. https://github.com/deeplearning-wisc/MCM

@AtsuMiyai
Copy link
Owner

@JiuqingDong Sorry for the delay reply.
Could you check you really use https://drive.google.com/file/d/1-61f_ol79pViBFDG_IDlUQSwoLcn2XXF/view?
Because this file you give and mine are different, so it is strange to have the same results.

@JiuqingDong
Copy link
Author

Dear Author,

I confirm that I used the file you gave me.
image

The OOD datasets are downloaded from the MCM repository.
The Texture dataset includes more than 5640 images, while the other three datasets include 10,000 images for each. Imagenet-1k include 1,281,167 images.
I will download and re-test it again. Thank you!

May I ask one more question that:
How to use your repository to implement CoOp? For example, comment out some modules or hyperparameters.

Sincerely,

@JiuqingDong
Copy link
Author

Thank you very much. When I totally re-tested(download the code, install the env...), I got a result that is consistent with yours. Maybe I did something wrong by mistake before.

By the way, How to use your repository to implement CoOp? For example, comment out some modules or hyperparameters.

@AtsuMiyai
Copy link
Owner

I'm glad to hear it!
As for the implementation of CoOp, you can comment like # out self.lambda_value * loss_en in https://github.com/AtsuMiyai/LoCoOp/blob/master/trainers/locoop.py#L299 (or in https://github.com/AtsuMiyai/LoCoOp/blob/master/trainers/locoop.py#L317)

@JiuqingDong
Copy link
Author

I truly appreciate your timely help.

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