mmasana / FACIL

Framework for Analysis of Class-Incremental Learning with 12 state-of-the-art methods and 3 baselines.
https://arxiv.org/pdf/2010.15277.pdf
MIT License
524 stars 99 forks source link

AssertionError: Error: BiC needs exemplars. #13

Closed ChibisukeDragon closed 2 years ago

ChibisukeDragon commented 2 years ago

I didn't change any code. So how to use approach BiC?

(FACIL) yupeng@ubuntu:~/FACIL$ python3 -u src/main_incremental.py --approach bic
============================================================================================================
Arguments =
        approach: bic
        batch_size: 64
        clipping: 10000
        datasets: ['cifar100']
        eval_on_train: False
        exp_name: None
        fix_bn: False
        gpu: 0
        gridsearch_tasks: -1
        keep_existing_head: False
        last_layer_analysis: False
        log: ['disk']
        lr: 0.1
        lr_factor: 3
        lr_min: 0.0001
        lr_patience: 5
        momentum: 0.0
        multi_softmax: False
        nc_first_task: None
        nepochs: 200
        network: resnet32
        no_cudnn_deterministic: False
        num_tasks: 4
        num_workers: 4
        pin_memory: False
        pretrained: False
        results_path: ../results
        save_models: False
        seed: 0
        stop_at_task: 0
        use_valid_only: False
        warmup_lr_factor: 1.0
        warmup_nepochs: 0
        weight_decay: 0.0
============================================================================================================
Approach arguments =
        T: 2
        lamb: -1
        num_bias_epochs: 200
        val_exemplar_percentage: 0.1
============================================================================================================
Exemplars dataset arguments =
        exemplar_selection: random
        num_exemplars: 0
        num_exemplars_per_class: 0
============================================================================================================
WARNING: ../results/cifar100_bic already exists!
Files already downloaded and verified
Files already downloaded and verified
Traceback (most recent call last):
  File "/home/yupeng/FACIL/src/main_incremental.py", line 316, in <module>
    main()
  File "/home/yupeng/FACIL/src/main_incremental.py", line 211, in main
    appr = Appr(net, device, **appr_kwargs)
  File "/home/yupeng/FACIL/src/approach/bic.py", line 43, in __init__
    assert (have_exemplars > 0), 'Error: BiC needs exemplars.'
AssertionError: Error: BiC needs exemplars.
(FACIL) yupeng@ubuntu:~/FACIL$
mmasana commented 2 years ago

AssertionError: Error: BiC needs exemplars. That means that you need to use exemplars with this method, it does not work without rehearsal.

You can read how to use most of the options on the READMEs at each folder. In the case of exemplars: here.

ChibisukeDragon commented 2 years ago

Thanks a lot!!! It works well ans fast! Summary: Modify the arguments in [src/datasets/exemplars_dataset.py]. ''' --num-exemplars 2000 --exemplar-selection herding '''