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

code for multi-gpu training #7

Closed
Adasunnylily opened this issue Aug 21, 2023 · 3 comments
Closed

code for multi-gpu training #7

Adasunnylily opened this issue Aug 21, 2023 · 3 comments

Comments

@Adasunnylily
Copy link

hi,it seems like the code provided is only for one GPU training, could you please provide the code for multi-gpu training?

@YueYANG1996
Copy link
Owner

We didn't implement the multi-gpu training, since we just train a single linear layer, the training of LaBo is very fast (one epoch of entire ImageNet only takes around 10 minutes). The time-consuming part of the code could be the feature precompute, but it will only run once. Feel free to implement multi-gpu by yourself and I believe it is easy to do with pytorch-lightning.

@Adasunnylily
Copy link
Author

Many thanks for your help, I will try it later.
I have met another problem with using apricot when I implement experiments on cub. I follow the cfg provided and in it the parameter concept_select_fn = "submodular". But I got this error

File "/opt/conda/lib/python3.7/site-packages/apricot/functions/base.py", line 202, in fit
raise ValueError("X cannot contain negative values or must be entirely "
ValueError: X cannot contain negative values or must be entirely negative values

when execute the code
"selected = selector.fit(augmented_concept_features).ranking"
in /home/zhangyx3/LaBo/models/select_concept/select_algo.py,
I print the augumented_concept_features which is composed of text features and mi_score and found it indeed has both positive and negative values, but the fit func in apricot only support all positive or all negative values,
I couldn't find which part is wrong so I tried to solve this error by adding the opposite of the minimum value then changing all values in the "augumented_concept_features" into positive values, it can run then, but the result I got is about 2 point decrease compared to the results provided in the paper (table 10) on cub dataset almost in all settings(4、8、16、all-shots).
Could you please tell me where probably this error comes (I haven't change anything of the code), and is there any missing preprocess for augmented_concept_features that I can help improve my results?
Many Thanks!!!

@YueYANG1996
Copy link
Owner

YueYANG1996 commented Aug 22, 2023

check this: #1 (comment)

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