Code Monkey home page Code Monkey logo

icarl's Introduction

A PyTorch Implementation of iCaRL

A PyTorch Implementation of iCaRL: Incremental Classifier and Representation Learning.

The code implements experiments on CIFAR-10 and CIFAR-100

Notes

  • This code does not reproduce the results from the paper. This may be due to following reasons:
    1. Different hyperparameters than the original ones in the paper (e.g. learning rate schedules).
    2. Different loss function; I replaced BCELoss to CrosEntropyLoss since it seemd to produce better results.
    3. I tried to replicate the algorithm exactly as described in the paper, but I might have missed some of the details.
  • Versions
    • Python 2.7
    • PyTorch v0.1.12

icarl's People

Contributors

donlee90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

icarl's Issues

the output dim of network and the issue of loss

hi, I read your code and I have two questions
the first one: in this paper, the author didn't mentioned to add the dim of output when training on new tasks, but your code added nodes for fully conneted layer when training on new tasks.
the second one: in this paper, classification loss has two parts, one is about traditional CE Loss, and another is the CE Loss with none target labels and "1 - prediction".
Thanks for your attention!

About construct_exemplar_set algorithm

icarl/model.py

Line 145 in b2eaefe

#features = np.delete(features, i, axis=0)

I consider that delete the selected feature is necessary. Otherwise it will select the same feature every time. Paper seems not metioned this details. I noted that you have metioned this in Line 145 of 'model.py', but you had commented these code somehow, do you have any experiments or theory analysis about this?

problems of version not fitted

It seems that the code can't be run on python of which the version is over 3.
(like 'xrange' is no longer used in python3, we change it in to'range' but failed to run the code.)
Would you plz give us some guidance of this problem?

Come upon this error when i try to run main.py, please help

PS D:\local\icarl> python main.py
loop
Loading training examples for classes range(0, 10)
Files already downloaded and verified
Files already downloaded and verified
9 new classes
Loading training examples for classes range(0, 10)
Files already downloaded and verified
Files already downloaded and verified
9 new classes
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\LocalAdmin\anaconda3\lib\runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\LocalAdmin\anaconda3\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\LocalAdmin\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\local\icarl\main.py", line 86, in
icarl.update_representation(train_set)
File "D:\local\icarl\model.py", line 182, in update_representation
for indices, images, labels in loader:
File "C:\Users\LocalAdmin\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 355, in iter
return self._get_iterator()
File "C:\Users\LocalAdmin\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 301, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "C:\Users\LocalAdmin\anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 914, in init
w.start()
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\LocalAdmin\anaconda3\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Result compared to paper

Thanks for sharing the code.

What accuracy can you achieve on cifar100?

I tried to run the code, however, I cannot get anything close to the result reported in the paper.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.