This repo contains the code of the submission "Adaptive Margin Global Classifier for Exemplar-Free Class-Incremental Learning".
First we recommend to create a conda environment with all the required packages by using the following command.
conda env create -f environment.yml
This command creates a conda environment named AMGC. You can activate the conda environment with the following command:
conda activate AMGC
In the following sections, we assume that you use this conda environment or you manually install the required packages.
Note that you may need to adapt the environment.yml files to your infrastructure. The configuration of these files was tested on Linux Platform with a GPU (RTX3080 Ti).
If you see the following error, you may need to install a PyTorch package compatible with your infrastructure.
RuntimeError: No HIP GPUs are available or ImportError: libtinfo.so.5: cannot open shared object file: No such file or directory
For example if your infrastructure only supports CUDA == 11.7, you may need to install the PyTorch package using CUDA11.7.
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
Experiments on CIFAR100 and ImageNet-Subset . When training on CIFAR100, this framework will automatically download it. When training on ImageNet-Subset , you should specify the folder of your dataset in utils/data.py.
def download_data(self):
train_dir = '[DATA-PATH]/train/'
test_dir = '[DATA-PATH]/val/'Experiments are under the EFCIL-E settings.
Training:
1.CIFAR100,T=20
python main.py --config=./exps/amgc_cifarT20.json2.ImageNet-Subset,T=20
python main.py --config=./exps/amgc_imageT20.jsonTesting:
CIFAR100,T=20
python main.py --config=./exps/amgc_cifarT20.json --test