ybendou / easy

This repository is the official implementation Ensemble Augmented-Shot Y-shaped Learning: State-Of-The-Art Few-Shot Classification with Simple Ingredients.
MIT License
112 stars 18 forks source link

About GPU memory #9

Closed jerryshih1106 closed 2 years ago

jerryshih1106 commented 2 years ago

Hi,

I try to test features on cifarfs by this command: """ $ python main.py --dataset-path "" --dataset cifarfs --model resnet12 --test-features "[/AS1.pt11, /AS2.pt11, /AS3.pt11]" --preprocessing ME --n-shots 1 """ and it output "RuntimeError: CUDA out of memory".

I am using 3080 GPU with 8GB memory. I also tried colab and got the same problem. May I know how to fix it?

Thanks

ybendou commented 2 years ago

Hi,

Sorry for the late response. It is probably due to small GPU memory. We have added a new version with a parameter --batch-fswhich controls the batch size during few shot evaluation. Can you do a pull then try to run the script with the new parameter : $ python main.py --dataset-path "" --dataset cifarfs --model resnet12 --test-features "[/AS1.pt11, /AS2.pt11, /AS3.pt11]" --preprocessing ME --n-shots 1 --batch-fs 20 Default value was 100, I just pushed a new version with default value as 20. If it's still not working, can you try to reduce it even more?

Best,

jerryshih1106 commented 2 years ago

It works! Thank you very much.