'DQNStrategy' object has no attribute 'clock'

#20 · open · 1 comments

View on GitHub ↗

Ai360n

Hello, I am writing to inform you that there is a problem between the avalanche-rl and DQNStrategy. Unfortunately, in avalanche-rl when a strategy uses EWC plugin, below error will be raise: Error for Compute EWC penalty and add it to the loss. exp_counter = strategy.clock.train_exp_counter if exp_counter == 0: return 'DQNStrategy' object has no attribute 'clock'. It needs to add 'clock' attribute in 'DQNStrategy'. I will appreciate if you update this bug in the avalanhe-rl. avalanche-lib==0.3.1

Comments

tobiapoppi

Hi @Ai360n, I'm having the same problem right now, but if you don't need the clock and you just need an alternative way to use the experience_counter, then just use the `training_exp_counter` attribute of the `RLBaseStrategy` class, which has the same meaning of train_exp_counter. So inside ewc.py of avalanche just change your line to `exp_counter = strategy.training_exp_counter` (in both before_backward and after_training_exp methods). Of course in order to do this you should have installed avalanche 0.3.1 locally with `pip install -e .` option, in order to use your local modifies as the library.